diff --git a/octoserve/Makefile b/octoserve/Makefile new file mode 100644 index 0000000..d6ca867 --- /dev/null +++ b/octoserve/Makefile @@ -0,0 +1,16 @@ +CFLAGS ?= -Os +#CFLAGS += -Wall +CFLAGS += -D_GNU_SOURCE -DIGNORE_NS +#CFLAGS += -ansi +CC = gcc + +all: octoserve + +octoserve: octoserve.h octoserve.o ssdp.o ntools.o dvb.o config.o http.o igmp.o switch.o + $(CC) $(CFLAGS) -ldvbcfg -ldvben50221 -lucsi -ldvbsec -ldvbapi -lpthread -o $@ $^ + +setmod: octoserve.h octoserve.o dvb.o config.o + $(CC) $(CFLAGS) -ldvbcfg -ldvben50221 -lucsi -ldvbsec -ldvbapi -lpthread -o $@ $^ + +clean: + rm *.o diff --git a/octoserve/boot/bs.img b/octoserve/boot/bs.img new file mode 100755 index 0000000..91855bd Binary files /dev/null and b/octoserve/boot/bs.img differ diff --git a/octoserve/boot/fpga.img b/octoserve/boot/fpga.img new file mode 100644 index 0000000..b0d8b98 Binary files /dev/null and b/octoserve/boot/fpga.img differ diff --git a/octoserve/boot/fpga_gtl.img b/octoserve/boot/fpga_gtl.img new file mode 100644 index 0000000..f815e30 Binary files /dev/null and b/octoserve/boot/fpga_gtl.img differ diff --git a/octoserve/config.c b/octoserve/config.c new file mode 100644 index 0000000..d0564f5 --- /dev/null +++ b/octoserve/config.c @@ -0,0 +1,56 @@ +/* + (C) 2012-13 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#include "octoserve.h" + +void parse_config(struct octoserve *os, char *sec, + void (*cb)(struct octoserve *, char *, char *) ) +{ + char line[256], csec[80], par[80], val[80], *p; + FILE *f; + + if ((f = fopen ("/config/octoserve.conf", "r")) == NULL) + return; + + while ((p = fgets(line, sizeof(line), f))) { + if (*p == '\r' || *p == '\n' || *p == '#') + continue; + if (*p == '[') { + if ((p = strtok(line + 1, "]")) == NULL) + continue; + strncpy(csec, p, sizeof(csec)); + //printf("current section %s\n", csec); + if (!strcmp(sec, csec) && cb) + cb(os, NULL, NULL); + continue; + } + if (!(p = strtok(line, "="))) + continue; + strncpy(par, p, sizeof(par)); + if (!(p = strtok(NULL, "="))) + continue; + strncpy (val, p, sizeof(val)); + //printf("%s=%s\n", par, val); + if (!strcmp(sec, csec) && cb) + cb(os, par, val); + } + if (!strcmp(sec, csec) && cb) + cb(os, NULL, NULL); + fclose(f); +} diff --git a/octoserve/dvb.c b/octoserve/dvb.c new file mode 100644 index 0000000..119ec86 --- /dev/null +++ b/octoserve/dvb.c @@ -0,0 +1,1368 @@ +/* + (C) 2012-14 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#include "octoserve.h" + +extern uint32_t debug; + +#define MMI_STATE_CLOSED 0 +#define MMI_STATE_OPEN 1 +#define MMI_STATE_ENQ 2 +#define MMI_STATE_MENU 3 + + +static int set_fmode(uint32_t fmode) +{ + FILE *f; + + if ((f = fopen ("/sys/class/ddbridge/ddbridge0/fmode1", "r+")) == NULL) + return -1; + fprintf(f, "%u", fmode); + fclose(f); + return 0; +} + + +#include +#include +#include +#include +#include + +int sectest(void) +{ + uint8_t ts[4096]; + struct dvb_nsd_ts nsdts; + int nsd, r, secstat, len; + struct section_buf secbuf; + struct section *section; + struct section_ext *section_ext = NULL; + + section_buf_init(&secbuf, 4096); + memset (&nsdts, 0, sizeof(nsdts)); + nsdts.pid = 0; + nsdts.ts = ts; + nsdts.mode = 1; + while ((nsd = open("/dev/dvb/adapter0/nsd0", O_RDWR)) < 0) { + if (errno == EBUSY) + usleep(10000); + else + return -1; + } + ioctl(nsd, NSD_START_GET_TS, &nsdts); + while ((r = ioctl(nsd, NSD_POLL_GET_TS, &nsdts)) < 0 && errno == EBUSY) + usleep(1000); + if (!r) { +#if 0 + len = section_buf_add(&secbuf, nsdts.ts, nsdts.len, &secstat); + section = section_codec(section_buf_data(&secbuf), len); + section_ext = section_ext_decode(section, 1); +#endif + dbgprintf(DEBUG_DVB, "read %d bytes:\n", nsdts.len); + dump(ts, nsdts.len); + } + ioctl(nsd, NSD_STOP_GET_TS, &nsdts); + close(nsd); +} + +static pthread_mutex_t nsd_lock; + +static int getsec(int input, uint16_t pid, uint16_t id, uint8_t table, uint8_t *sec) +{ + struct dvb_nsd_ts nsdts; + int nsd, r, len; + + dbgprintf(DEBUG_DVB, + "getsec input %d, pid %04x, id %04x, table %d\n", input, pid, id, table); + pthread_mutex_lock(&nsd_lock); + memset (&nsdts, 0, sizeof(nsdts)); + nsdts.pid = pid; + nsdts.ts = sec; + nsdts.mode = 1; + nsdts.table = table; + nsdts.input = input; + if (id != 0) { + nsdts.filter_mask = 2; + nsdts.section_id = id; + } + + while ((nsd = open("/dev/dvb/adapter0/nsd0", O_RDWR)) < 0) { + if (errno == EBUSY) + usleep(100000); + else + return -1; + } + ioctl(nsd, NSD_START_GET_TS, &nsdts); + while ((r = ioctl(nsd, NSD_POLL_GET_TS, &nsdts)) < 0 && errno == EBUSY) + usleep(1000); + ioctl(nsd, NSD_STOP_GET_TS, &nsdts); + close(nsd); + pthread_mutex_unlock(&nsd_lock); + if (!r) + return nsdts.len; + else + return -1; +} + +static int set_property(int fd, uint32_t cmd, uint32_t data) +{ + struct dtv_property p; + struct dtv_properties c; + int ret; + + p.cmd = cmd; + c.num = 1; + c.props = &p; + p.u.data = data; + ret = ioctl(fd, FE_SET_PROPERTY, &c); + if (ret < 0) { + fprintf(stderr, "FE_SET_PROPERTY returned %d\n", ret); + return -1; + } + return 0; +} + + +static int set_fe(int fd, uint32_t fr, uint32_t sr, fe_delivery_system_t ds) +{ + struct dtv_property p[] = { + { .cmd = DTV_CLEAR }, + { .cmd = DTV_DELIVERY_SYSTEM, .u.data = ds }, + { .cmd = DTV_FREQUENCY, .u.data = fr }, + { .cmd = DTV_INVERSION, .u.data = INVERSION_AUTO }, + { .cmd = DTV_SYMBOL_RATE, .u.data = sr }, + { .cmd = DTV_INNER_FEC, .u.data = FEC_AUTO }, + { .cmd = DTV_TUNE }, + }; + struct dtv_properties c; + int ret; + + printf("ds = %u\n", ds); + + c.num = 7; + c.props = p; + ret = ioctl(fd, FE_SET_PROPERTY, &c); + if (ret < 0) { + fprintf(stderr, "FE_SET_PROPERTY returned %d\n", ret); + return -1; + } + return 0; +} + +static int set_fe_old(int fd, uint32_t fr, uint32_t sr) +{ + struct dvb_frontend_parameters p = { + .frequency = fr, + .inversion = INVERSION_AUTO, + .u.qpsk.symbol_rate = sr, + .u.qpsk.fec_inner = FEC_AUTO, + }; + + dbgprintf(DEBUG_DVB, "set front %d %d \n", fr, sr); + if (ioctl(fd, FE_SET_FRONTEND, &p) == -1) { + perror("FE_SET_FRONTEND error"); + return -1; + } + return 0; +} + +static void diseqc_send_msg(int fd, fe_sec_voltage_t v, + struct dvb_diseqc_master_cmd *cmd, + fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b, + int wait) +{ + if (ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) == -1) + perror("FE_SET_TONE failed"); + if (ioctl(fd, FE_SET_VOLTAGE, v) == -1) + perror("FE_SET_VOLTAGE failed"); + usleep(15 * 1000); + if (ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, cmd) == -1) + perror("FE_DISEQC_SEND_MASTER_CMD failed"); + usleep(wait * 1000); + usleep(15 * 1000); + if (ioctl(fd, FE_DISEQC_SEND_BURST, b) == -1) + perror("FE_DISEQC_SEND_BURST failed"); + usleep(15 * 1000); + if (ioctl(fd, FE_SET_TONE, t) == -1) + perror("FE_SET_TONE failed"); +} + +static int diseqc(int fd, int sat, int hor, int band) +{ + struct dvb_diseqc_master_cmd cmd = { + .msg = {0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, + .msg_len = 4 + }; + + hor &= 1; + cmd.msg[3] = 0xf0 | ( ((sat << 2) & 0x0c) | (band ? 1 : 0) | (hor ? 2 : 0)); + + diseqc_send_msg(fd, hor ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13, + &cmd, band ? SEC_TONE_ON : SEC_TONE_OFF, + (sat & 1) ? SEC_MINI_B : SEC_MINI_A, 0); + return 0; +} + +static int set_en50494(int fd, uint32_t freq, uint32_t sr, + int sat, int hor, int band, + uint32_t slot, uint32_t ubfreq, + fe_delivery_system_t ds) +{ + struct dvb_diseqc_master_cmd cmd = { + .msg = {0xe0, 0x11, 0x5a, 0x00, 0x00}, + .msg_len = 5 + }; + uint16_t t; + + t = (freq + ubfreq + 2) / 4 - 350; + hor &= 1; + + cmd.msg[3] = ((t & 0x0300) >> 8) | + (slot << 5) | (sat ? 0x10 : 0) | (band ? 4 : 0) | (hor ? 8 : 0); + cmd.msg[4] = t & 0xff; + + if (ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) == -1) + perror("FE_SET_TONE failed"); + if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18) == -1) + perror("FE_SET_VOLTAGE failed"); + usleep(15000); + if (ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd) == -1) + perror("FE_DISEQC_SEND_MASTER_CMD failed"); + usleep(15000); + if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_13) == -1) + perror("FE_SET_VOLTAGE failed"); + + set_fe(fd, ubfreq * 1000, sr * 1000, ds); + dbgprintf(DEBUG_DVB, "%02x %02x %02x %02x %02x\n", + cmd.msg[0], cmd.msg[1], cmd.msg[2], cmd.msg[3], cmd.msg[4]); +} + +static int set_en50607(int fd, uint32_t freq, uint32_t sr, + int sat, int hor, int band, + uint32_t slot, uint32_t ubfreq, + fe_delivery_system_t ds) +{ + struct dvb_diseqc_master_cmd cmd = { + .msg = {0x70, 0x00, 0x00, 0x00, 0x00}, + .msg_len = 4 + }; + uint32_t t = (freq / 1000) - 100; + + hor &= 1; + cmd.msg[1] = slot << 3; + cmd.msg[1] |= ((t >> 8) & 0x07); + cmd.msg[2] = (t & 0xff); + cmd.msg[3] = ((sat & 0x3f) << 2) | (hor ? 2 : 0) | (band ? 1 : 0); + + if (ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) == -1) + perror("FE_SET_TONE failed"); + if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18) == -1) + perror("FE_SET_VOLTAGE failed"); + usleep(15000); + if (ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd) == -1) + perror("FE_DISEQC_SEND_MASTER_CMD failed"); + usleep(15000); + if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_13) == -1) + perror("FE_SET_VOLTAGE failed"); + + set_fe(fd, ubfreq * 1000, sr * 1000, ds); + dbgprintf(DEBUG_DVB, "%02x %02x %02x %02x %02x\n", + cmd.msg[0], cmd.msg[1], cmd.msg[2], cmd.msg[3], cmd.msg[4]); +} + +static int tune_sat(struct dvbfe *fe) +{ + uint32_t freq, hi = 0, src, lnb = 0, lofs; + fe_delivery_system_t ds = fe->n_param[PARAM_MSYS] - 1; + + dbgprintf(DEBUG_DVB, "tune_sat\n"); + freq = fe->param[PARAM_FREQ]; + + if (fe->param[PARAM_SRC]) + lnb = fe->param[PARAM_SRC] - 1; + + lofs = fe->lofs[lnb]; +#if 0 + if (freq < 5000000) { //3400 - 4200 ->5150 + lofs = 5150000; + if (freq > lofs) + freq -= lofs; + else + freq = lofs - freq; + } else if (freq > 19700000 && freq < 22000000) { //19700-22000 ->21200 + lofs = 21200000; + if (freq > lofs) + freq -= lofs; + else + freq = lofs - freq; + } else +#endif + { + if (lofs) + hi = (freq > lofs) ? 1 : 0; + if (hi) + freq -= fe->lof2[lnb]; + else + freq -= fe->lof1[lnb]; + } + if (fe->first) { + fe->first = 0; + dbgprintf(DEBUG_DVB, "pre voltage %d\n", fe->prev_delay[lnb]); + if (ioctl(fe->fd, FE_SET_VOLTAGE, SEC_VOLTAGE_13) == -1) + perror("FE_SET_VOLTAGE failed"); + usleep(fe->prev_delay[lnb]); + } + if (fe->scif_type == 1) { + pthread_mutex_lock(&fe->os->uni_lock); + set_en50494(fe->fd, freq / 1000, fe->param[PARAM_SR], + fe->param[PARAM_SRC] - 1, fe->param[PARAM_POL] - 1, hi, + fe->scif_slot, fe->scif_freq, ds); + pthread_mutex_unlock(&fe->os->uni_lock); + } else if (fe->scif_type == 2) { + set_en50607(fe->fd, freq / 1000, fe->param[PARAM_SR], + fe->param[PARAM_SRC] - 1, fe->param[PARAM_POL] - 1, hi, + fe->scif_slot, fe->scif_freq, ds); + } else { + diseqc(fe->fd, fe->param[PARAM_SRC] - 1, fe->param[PARAM_POL] - 1, hi); + set_fe(fe->fd, freq, fe->param[PARAM_SR] * 1000, ds); + } +} + +static int tune_c(struct dvbfe *fe) +{ + struct dtv_property p[] = { + { .cmd = DTV_CLEAR }, + { .cmd = DTV_FREQUENCY, .u.data = fe->param[PARAM_FREQ] * 1000 }, + { .cmd = DTV_BANDWIDTH_HZ, .u.data = fe->param[PARAM_BW_HZ] ? : 8000000 }, + { .cmd = DTV_SYMBOL_RATE, .u.data = fe->param[PARAM_SR] * 1000 }, + { .cmd = DTV_INNER_FEC, + .u.data = fe->param[PARAM_FEC] ? (fe->param[PARAM_FEC] - 1) : FEC_AUTO}, + { .cmd = DTV_TUNE }, + }; + struct dtv_properties c; + int ret; + + set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBC_ANNEX_A); + + c.num = 6; + c.props = p; + ret = ioctl(fe->fd, FE_SET_PROPERTY, &c); + if (ret < 0) { + fprintf(stderr, "FE_SET_PROPERTY returned %d\n", ret); + return -1; + } + return 0; +} + +static int tune_cable(struct dvbfe *fe) +{ + uint32_t freq; + struct dvb_frontend_parameters p = { + .frequency = fe->param[PARAM_FREQ] * 1000, + .u.qam.symbol_rate = fe->param[PARAM_SR] * 1000, + .u.qam.fec_inner = fe->param[PARAM_FEC] ? (fe->param[PARAM_FEC] - 1) : FEC_AUTO, + .u.qam.modulation = fe->param[PARAM_MTYPE] - 1, + }; + set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBC_ANNEX_A); + if (ioctl(fe->fd, FE_SET_FRONTEND, &p) == -1) { + perror("FE_SET_FRONTEND error"); + return -1; + } + return 0; +} + +static int tune_terr(struct dvbfe *fe) +{ + struct dtv_property p[] = { + { .cmd = DTV_CLEAR }, + { .cmd = DTV_FREQUENCY, .u.data = fe->param[PARAM_FREQ] * 1000 }, + { .cmd = DTV_BANDWIDTH_HZ, .u.data = fe->param[PARAM_BW_HZ] }, + { .cmd = DTV_TUNE }, + }; + struct dtv_properties c; + int ret; + + set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBT); + + c.num = 4; + c.props = p; + ret = ioctl(fe->fd, FE_SET_PROPERTY, &c); + if (ret < 0) { + fprintf(stderr, "FE_SET_PROPERTY returned %d\n", ret); + return -1; + } + return 0; +} +#if 0 +static int tune_terr(struct dvbfe *fe) +{ + uint32_t freq; + enum fe_bandwidth bw; + struct dvb_frontend_parameters p = { + .frequency = fe->param[PARAM_FREQ] * 1000, + .inversion = INVERSION_AUTO, + .u.ofdm.code_rate_HP = FEC_AUTO, + .u.ofdm.code_rate_LP = FEC_AUTO, + .u.ofdm.constellation = fe->param[PARAM_MTYPE] - 1, + .u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO, + .u.ofdm.guard_interval = GUARD_INTERVAL_AUTO, + .u.ofdm.hierarchy_information = HIERARCHY_AUTO, + .u.ofdm.bandwidth = fe->param[PARAM_BW] ? + (fe->param[PARAM_BW] - 1) : BANDWIDTH_AUTO, + }; + set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBT); + if (ioctl(fe->fd, FE_SET_FRONTEND, &p) == -1) { + perror("FE_SET_FRONTEND error"); + return -1; + } + return 0; +} +#endif + +static int tune_c2(struct dvbfe *fe) +{ + struct dtv_property p[] = { + { .cmd = DTV_CLEAR }, + { .cmd = DTV_FREQUENCY, .u.data = fe->param[PARAM_FREQ] * 1000 }, + { .cmd = DTV_BANDWIDTH_HZ, .u.data = fe->param[PARAM_BW_HZ] }, + { .cmd = DTV_STREAM_ID, .u.data = fe->param[PARAM_PLP] }, + { .cmd = DTV_TUNE }, + }; + struct dtv_properties c; + int ret; + + set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBC2); + + c.num = 5; + c.props = p; + ret = ioctl(fe->fd, FE_SET_PROPERTY, &c); + if (ret < 0) { + fprintf(stderr, "FE_SET_PROPERTY returned %d\n", ret); + return -1; + } + return 0; +} + +static int tune_terr2(struct dvbfe *fe) +{ + struct dtv_property p[] = { + { .cmd = DTV_CLEAR }, + { .cmd = DTV_FREQUENCY, .u.data = fe->param[PARAM_FREQ] * 1000 }, + { .cmd = DTV_BANDWIDTH_HZ, .u.data = fe->param[PARAM_BW_HZ] }, + { .cmd = DTV_STREAM_ID, .u.data = fe->param[PARAM_PLP] }, + { .cmd = DTV_TUNE }, + }; + struct dtv_properties c; + int ret; + + set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBT2); + + c.num = 5; + c.props = p; + ret = ioctl(fe->fd, FE_SET_PROPERTY, &c); + if (ret < 0) { + fprintf(stderr, "FE_SET_PROPERTY returned %d\n", ret); + return -1; + } + return 0; +} + +static int tune(struct dvbfe *fe) +{ + int ret; + + printf("tune()\n"); + + switch (fe->n_param[PARAM_MSYS] - 1) { + case SYS_DVBS: + case SYS_DVBS2: + ret = tune_sat(fe); + break; + case SYS_DVBC_ANNEX_A: + ret = tune_c(fe); + break; + case SYS_DVBT: + ret = tune_terr(fe); + break; + case SYS_DVBT2: + ret = tune_terr2(fe); + break; + case SYS_DVBC2: + ret = tune_c2(fe); + break; + default: + break; + } + return ret; +} + +static int open_dmx(struct dvbfe *fe) +{ + char fname[80]; + struct dmx_pes_filter_params pesFilterParams; + + sprintf(fname, "/dev/dvb/adapter%u/demux%u", fe->anum, fe->fnum); + + fe->dmx = open(fname, O_RDWR); + if (fe->dmx < 0) + return -1; + + pesFilterParams.input = DMX_IN_FRONTEND; + pesFilterParams.output = DMX_OUT_TS_TAP; + pesFilterParams.pes_type = DMX_PES_OTHER; + pesFilterParams.flags = DMX_IMMEDIATE_START; + pesFilterParams.pid = 0x00; + + if (ioctl(fe->dmx, DMX_SET_PES_FILTER, &pesFilterParams) < 0) + return -1; + return 0; +} + + +static int open_fe(struct dvbfe *fe) +{ + char fname[80]; + + sprintf(fname, "/dev/dvb/adapter%d/frontend%d", fe->anum, fe->fnum); + fe->fd = open(fname, O_RDWR); + if (fe->fd < 0) + return -1; + return 0; +} + +static void get_stats(struct dvbfe *fe) +{ + uint16_t sig = 0, snr = 0; + fe_status_t stat; + + ioctl(fe->fd, FE_READ_STATUS, &stat); + ioctl(fe->fd, FE_READ_SIGNAL_STRENGTH, &sig); + ioctl(fe->fd, FE_READ_SNR, &snr); + fe->stat = stat; + fe->lock = (stat == 0x1f) ? 1 : 0; + + /* FIXME: use new stats API */ + if (fe->type & (1UL << SYS_DVBS2)) { + fe->level = sig >> 8; + fe->quality = snr >> 12; + } else { + fe->level = sig >> 2; + fe->quality = snr >> 9; + } + dbgprintf(DEBUG_DVB, "fe%d: stat=%02x str=%04x snr=%04x\n", fe->nr, stat, sig, snr); +} + +void handle_fe(struct dvbfe *fe) +{ + uint32_t newtune, count = 0, max, nolock = 0; + int ret; + + fe->dmx = -1; + fe->tune = 0; + memset(fe->param, 0, sizeof(fe->param)); + fe->first = 1; + open_fe(fe); + open_dmx(fe); + while (fe->state == 1) { + pthread_mutex_lock(&fe->mutex); + newtune = fe->n_tune; + if (newtune == 1) { + fe->n_tune = 0; + if (!memcmp(fe->param, fe->n_param, sizeof(fe->param))) { + dbgprintf(DEBUG_DVB, "same params\n"); + fe->tune = 2; + count = 0; + nolock = 10; + max = 2; + } else { + memcpy(fe->param, fe->n_param, sizeof(fe->param)); + fe->tune = 1; + } + } + pthread_mutex_unlock(&fe->mutex); + + switch (fe->tune) { + case 1: + dbgprintf(DEBUG_DVB, "fe %d tune\n", fe->nr); + tune(fe); + nolock = 0; + count = 0; + max = 2; + dbgprintf(DEBUG_DVB, "fe %d tune done\n", fe->nr); + fe->tune = 2; + break; + case 2: + count++; + if (count < max) + break; + count = 0; + get_stats(fe); + if (fe->lock) { + max = 20; + nolock = 0; + } else { + max = 1; + nolock++; + if (nolock > 20) + fe->tune = 1; + } + break; + + default: + break; + } + if (fe->state != 1) + break; + usleep(50000); + } + close(fe->fd); + if (fe->dmx > 0) + close(fe->dmx); + fe->fd = -1; + fe->dmx = -1; + fe->stat = fe->lock = fe->level = fe->quality = 0; + fe->state = 0; + dbgprintf(DEBUG_DVB, "fe %d done\n", fe->nr); +} + +int dvb_tune(struct dvbfe *fe, struct dvb_params *p) +{ + int ret = 0; + + dbgprintf(DEBUG_DVB, "dvb_tune\n"); + pthread_mutex_lock(&fe->mutex); + memcpy(fe->n_param, p->param, sizeof(fe->n_param)); + fe->n_tune = 1; + pthread_mutex_unlock(&fe->mutex); + pthread_yield(); + return ret; +} + +static int init_fe(struct octoserve *os, int a, int f, int fd, int nodvbt, int noswitch) +{ + struct dtv_properties dps; + struct dtv_property dp[10]; + struct dvbfe *fe; + int r; + uint32_t i, ds; + + dbgprintf(DEBUG_DVB, "detect_dvb a=%d f=%d\n", a,f); + fe = &os->dvbfe[os->dvbfe_num]; + dps.num = 1; + dps.props = dp; + dp[0].cmd = DTV_ENUM_DELSYS; + r = ioctl(fd, FE_GET_PROPERTY, &dps); + if (r < 0) + return -1; + for (i = 0; i < dp[0].u.buffer.len; i++) { + ds = dp[0].u.buffer.data[i]; + dbgprintf(DEBUG_DVB, "delivery system %d\n", ds); + fe->type |= (1UL << ds); + } + if (nodvbt) + fe->type &= ~((1UL << SYS_DVBT2) | (1UL << SYS_DVBT)); + + if (!fe->type) + return -1; + + if (fe->type & (1UL << SYS_DVBS2)) + os->dvbs2num++; + if (fe->type & (1UL << SYS_DVBT2)) + os->dvbt2num++; + else if (fe->type & (1UL << SYS_DVBT)) + os->dvbtnum++; + if (fe->type & (1UL << SYS_DVBC2)) + os->dvbc2num++; + else if (fe->type & (1UL << SYS_DVBC_ANNEX_A)) + os->dvbcnum++; + fe->os = os; + fe->anum = a; + fe->fnum = f; + fe->nr = os->dvbfe_num + 1; + + dps.num = 1; + dps.props = dp; + dp[0].cmd = DTV_INPUT; + r = ioctl(fd, FE_GET_PROPERTY, &dps); + if (r < 0) + return -1; + for (i = 0; i < dp[0].u.buffer.len; i++) { + fe->input[i] = dp[0].u.buffer.data[i]; + dbgprintf(DEBUG_DVB, "input prop %u = %u\n", i, fe->input[i]); + } + if (fe->input[3]) { + os->has_feswitch = 1; + if (noswitch) { + if (fe->input[2] >= fe->input[1]) { + fe->type = 0; + return -1; + } + } else + os->do_feswitch = 1; + } + + os->dvbfe_num++; + pthread_mutex_init(&fe->mutex, 0); + return 0; +} + +static int scan_dvbfe(struct octoserve *os, int nodvbt, int noswitch) +{ + int a, f, fd; + char fname[80]; + + for (a = 0; a < 16; a++) { + for (f = 0; f < 16; f++) { + sprintf(fname, "/dev/dvb/adapter%d/frontend%d", a, f); + fd = open(fname, O_RDWR); + if (fd >= 0) { + init_fe(os, a, f, fd, nodvbt, noswitch); + close(fd); + } + } + } + dbgprintf(DEBUG_DVB, "Found %d frontends\n", os->dvbfe_num); +} + +static int ai_callback(void *arg, uint8_t slot_id, uint16_t session_number, + uint8_t application_type, uint16_t application_manufacturer, + uint16_t manufacturer_code, uint8_t menu_string_length, + uint8_t *menu_string) +{ + struct dvbca *ca = arg; + + dbgprintf(DEBUG_DVB, "Application type: %02x\n", application_type); + dbgprintf(DEBUG_DVB, "Application manufacturer: %04x\n", application_manufacturer); + dbgprintf(DEBUG_DVB, "Manufacturer code: %04x\n", manufacturer_code); + dbgprintf(DEBUG_DVB, "Menu string: %.*s\n", menu_string_length, menu_string); + + return 0; +} + +static int ca_info_callback(void *arg, uint8_t slot_id, uint16_t snum, + uint32_t id_count, uint16_t *ids) +{ + struct dvbca *ca = arg; + uint32_t i; + + dbgprintf(DEBUG_DVB, "CAM supports the following ca system ids:\n"); + for (i = 0; i < id_count; i++) { + dbgprintf(DEBUG_DVB, " 0x%04x\n", ids[i]); + } + ca->resource_ready = 1; + return 0; +} + +#if 0 +static int handle_pmt(struct dvbca *ca, uint8_t *buf, int size) +{ + int listmgmt = CA_LIST_MANAGEMENT_ONLY; + uint8_t capmt[4096]; + struct section *section = section_codec(buf, size); + struct section_ext *section_ext = section_ext_decode(section, 0); + struct mpeg_pmt_section *pmt = mpeg_pmt_section_codec(section_ext); + + dbgprintf(DEBUG_DVB, "handle pmt\n"); + if (section_ext->version_number == ca->ca_pmt_version && + ca->pmt == ca->pmt_old) + return; + if (ca->pmt != ca->pmt_old) { + ca->pmt_old = ca->pmt; + ca->sentpmt = 0; + } + if (ca->resource_ready) { + ca->data_pmt_version = pmt->head.version_number; + + if (ca->sentpmt) { + listmgmt = CA_LIST_MANAGEMENT_UPDATE; + //return; + } + ca->sentpmt = 1; + dbgprintf(DEBUG_DVB, "set ca_pmt\n"); + + if ((size = en50221_ca_format_pmt(pmt, capmt, sizeof(capmt), ca->moveca, listmgmt, + CA_PMT_CMD_ID_OK_DESCRAMBLING)) < 0) { + dbgprintf(DEBUG_DVB, "Failed to format PMT\n"); + return -1; + } + if (en50221_app_ca_pmt(ca->stdcam->ca_resource, ca->stdcam->ca_session_number, capmt, size)) { + dbgprintf(DEBUG_DVB, "Failed to send PMT\n"); + return -1; + } + } + +} +#endif + + +static void handle_tdt(struct dvbca *ca) +{ + struct section *section; + struct dvb_tdt_section *tdt; + uint8_t sec[4096]; + time_t dvb_time; + int len; + + if (ca->stdcam == NULL) + return; + if (ca->stdcam->dvbtime == NULL) + return; + len = getsec(ca->input, 0x14, 0, 0x70, sec); + if (len < 0) + return; + dbgprintf(DEBUG_DVB, "got tdt\n"); + + section = section_codec(sec, len); + if (section == NULL) + return; + tdt = dvb_tdt_section_codec(section); + if (tdt == NULL) + return; + dvb_time = dvbdate_to_unixtime(tdt->utc_time); + + dbgprintf(DEBUG_DVB, "set dvbtime\n"); + if (ca->stdcam->dvbtime) + ca->stdcam->dvbtime(ca->stdcam, dvb_time); +} + +static int handle_pmts(struct dvbca *ca) +{ + int listmgmt = CA_LIST_MANAGEMENT_ONLY; + uint8_t sec[4096], capmt[4096]; + struct section *section; + struct section_ext *section_ext; + struct mpeg_pmt_section *pmt; + int i, size, num, len; + + if (!ca->resource_ready) + return 0; + dbgprintf(DEBUG_DVB, "handle pmts\n"); + for (i = num = 0; i < MAX_PMT; i++) + if (ca->pmt[i]) + num++; + for (i = 0; i < num; i++) { + len = getsec(ca->input, ca->pmt[i] & 0xffff, ca->pmt[i] >> 16, 2, sec); + if (len < 0) + continue; + section = section_codec(sec, len); + section_ext = section_ext_decode(section, 0); + pmt = mpeg_pmt_section_codec(section_ext); + + ca->ca_pmt_version[i] = section_ext->version_number; + if (ca->sentpmt) { + //return 0; + listmgmt = CA_LIST_MANAGEMENT_UPDATE; + } else { + listmgmt = CA_LIST_MANAGEMENT_ONLY; + if (num > 1) { + listmgmt = CA_LIST_MANAGEMENT_MORE; + if (i == 0) + listmgmt = CA_LIST_MANAGEMENT_FIRST; + if (i == num - 1) + listmgmt = CA_LIST_MANAGEMENT_LAST; + } + } + dbgprintf(DEBUG_DVB, "set ca_pmt\n"); + + if ((size = en50221_ca_format_pmt(pmt, capmt, sizeof(capmt), ca->moveca, listmgmt, + CA_PMT_CMD_ID_OK_DESCRAMBLING)) < 0) { + dbgprintf(DEBUG_DVB, "Failed to format PMT\n"); + return -1; + } + dump(capmt, size); + if (en50221_app_ca_pmt(ca->stdcam->ca_resource, ca->stdcam->ca_session_number, capmt, size)) { + dbgprintf(DEBUG_DVB, "Failed to send PMT\n"); + return -1; + } + } + if (num) + ca->sentpmt = 1; + return 0; +} + +static void proc_csock_msg(struct dvbca *ca, uint8_t *buf, int len) +{ + if (*buf == '\r') { + return; + } else if (*buf == '\n') { + switch(ca->mmi_state) { + case MMI_STATE_CLOSED: + case MMI_STATE_OPEN: + if ((ca->mmi_bufp == 0) && (ca->resource_ready)) { + en50221_app_ai_entermenu(ca->stdcam->ai_resource, + ca->stdcam->ai_session_number); + } + break; + + case MMI_STATE_ENQ: + if (ca->mmi_bufp == 0) { + en50221_app_mmi_answ(ca->stdcam->mmi_resource, + ca->stdcam->mmi_session_number, + MMI_ANSW_ID_CANCEL, NULL, 0); + } else { + en50221_app_mmi_answ(ca->stdcam->mmi_resource, + ca->stdcam->mmi_session_number, + MMI_ANSW_ID_ANSWER, + ca->mmi_buf, ca->mmi_bufp); + } + ca->mmi_state = MMI_STATE_OPEN; + break; + + case MMI_STATE_MENU: + ca->mmi_buf[ca->mmi_bufp] = 0; + en50221_app_mmi_menu_answ(ca->stdcam->mmi_resource, + ca->stdcam->mmi_session_number, + atoi(ca->mmi_buf)); + ca->mmi_state = MMI_STATE_OPEN; + break; + } + ca->mmi_bufp = 0; + } else { + if (ca->mmi_bufp < (sizeof(ca->mmi_buf) - 1)) { + ca->mmi_buf[ca->mmi_bufp++] = *buf; + } + } +} + +static int proc_csock(struct dvbca *ca) +{ + uint8_t buf[1024]; + int len, i, res; + + if (ca->stdcam == NULL) + return; + while ((len = recv(ca->sock, buf, 1, 0)) >= 0) { + if (len == 0) + goto release; + if (len < 0) { + if (errno != EAGAIN) + goto release; + return 0; + } + proc_csock_msg(ca, buf, len); + } + return 0; +release: + close(ca->sock); + ca->sock = -1; + return -1; +} + +static void handle_ci(struct dvbca *ca) +{ + uint8_t sec[4096]; + uint32_t pmt_count, tdt_count; + int len; + int sock, i; + struct sockaddr sadr; + char port[6]; + + snprintf(port, sizeof(port), "%u", (uint16_t) (8888 + ca->nr)); + sock = streamsock(port, AF_INET, &sadr); + if (listen(sock, 4) < 0) { + dbgprintf(DEBUG_DVB, "listen error"); + return; + } + ca->sock = -1; + + while (!ca->os->exit) { + struct timeval timeout; + uint32_t count = 0; + int num; + int mfd; + fd_set fds; + + timeout.tv_sec = 0; + timeout.tv_usec = 200000; + FD_ZERO(&fds); + if (ca->sock < 0) { + FD_SET(sock, &fds); + num = select(sock + 1, &fds, NULL, NULL, &timeout); + } else { + FD_SET(ca->sock, &fds); + num = select(ca->sock + 1, &fds, NULL, NULL, &timeout); + } + if (num > 0) { + if (ca->sock < 0) { + if (FD_ISSET(sock, &fds)) { + socklen_t len; + struct sockaddr cadr; + + ca->sock = accept(sock, &cadr, &len); + if (ca->sock >= 0) { + set_nonblock(ca->sock); + } + } + } else { + if (FD_ISSET(ca->sock, &fds)) { + proc_csock(ca); + } + } + } + + pthread_mutex_lock(&ca->mutex); + if (!ca->state) { + pthread_mutex_unlock(&ca->mutex); + continue; + } + if (ca->setpmt) { + dbgprintf(DEBUG_DVB, "got new PMT %08x\n", ca->pmt_new); + memcpy(ca->pmt, ca->pmt_new, sizeof(ca->pmt)); + memset(ca->pmt_old, 0, sizeof(ca->pmt_old)); + for (i = 0; i < MAX_PMT; i++) + ca->ca_pmt_version[i] = -1; + ca->sentpmt = 0; + ca->setpmt = 0; + pmt_count = 0; + tdt_count = 0; + } + pthread_mutex_unlock(&ca->mutex); + + if (!ca->sentpmt) + handle_pmts(ca); + else { + pmt_count++; + if (pmt_count == 10) { + //handle_pmts(ca); + pmt_count = 0; + } + } + tdt_count++; + if (tdt_count == 10) { + handle_tdt(ca); + tdt_count = 0; + } + } +} + +int set_pmt(struct dvbca *ca, uint32_t *pmt) +{ + dbgprintf(DEBUG_DVB, "set_pmt %08x %08x %08x\n", pmt[0], pmt[1], pmt[2]); + pthread_mutex_lock(&ca->mutex); + ca->setpmt = 1; + memcpy(ca->pmt_new, pmt, sizeof(ca->pmt_new)); + pthread_mutex_unlock(&ca->mutex); + return 0; +} + +static void ci_poll(struct dvbca *ca) +{ + while (!ca->os->exit) { + ca->stdcam->poll(ca->stdcam); + + } +} + +static int mmi_close_callback(void *arg, uint8_t slot_id, uint16_t snum, + uint8_t cmd_id, uint8_t delay) +{ + struct dvbca *ca = arg; + + ca->mmi_state = MMI_STATE_CLOSED; + return 0; +} + +static int mmi_display_control_callback(void *arg, uint8_t slot_id, uint16_t snum, + uint8_t cmd_id, uint8_t mmi_mode) +{ + struct dvbca *ca = arg; + struct en50221_app_mmi_display_reply_details reply; + + if (cmd_id != MMI_DISPLAY_CONTROL_CMD_ID_SET_MMI_MODE) { + en50221_app_mmi_display_reply(ca->stdcam->mmi_resource, snum, + MMI_DISPLAY_REPLY_ID_UNKNOWN_CMD_ID, &reply); + return 0; + } + + // we only support high level mode + if (mmi_mode != MMI_MODE_HIGH_LEVEL) { + en50221_app_mmi_display_reply(ca->stdcam->mmi_resource, snum, + MMI_DISPLAY_REPLY_ID_UNKNOWN_MMI_MODE, &reply); + return 0; + } + + reply.u.mode_ack.mmi_mode = mmi_mode; + en50221_app_mmi_display_reply(ca->stdcam->mmi_resource, snum, + MMI_DISPLAY_REPLY_ID_MMI_MODE_ACK, &reply); + ca->mmi_state = MMI_STATE_OPEN; + return 0; +} + +static int mmi_enq_callback(void *arg, uint8_t slot_id, uint16_t snum, + uint8_t blind_answer, uint8_t expected_answer_length, + uint8_t *text, uint32_t text_size) +{ + struct dvbca *ca = arg; + + if (ca->sock >= 0) { + sendstring(ca->sock, "%.*s: ", text_size, text); + } + //mmi_enq_blind = blind_answer; + //mmi_enq_length = expected_answer_length; + ca->mmi_state = MMI_STATE_ENQ; + return 0; +} + +static int mmi_menu_callback(void *arg, uint8_t slot_id, uint16_t snum, + struct en50221_app_mmi_text *title, + struct en50221_app_mmi_text *sub_title, + struct en50221_app_mmi_text *bottom, + uint32_t item_count, struct en50221_app_mmi_text *items, + uint32_t item_raw_length, uint8_t *items_raw) +{ + uint32_t i; + struct dvbca *ca = arg; + + if (ca->sock >= 0) { + if (title->text_length) + sendstring(ca->sock, "%.*s\n", title->text_length, title->text); + if (sub_title->text_length) + sendstring(ca->sock, "%.*s\n", sub_title->text_length, sub_title->text); + for (i = 0; i < item_count; i++) + sendstring(ca->sock, "%i. %.*s\n", i + 1, items[i].text_length, items[i].text); + if (bottom->text_length) + sendstring(ca->sock, "%.*s\n", bottom->text_length, bottom->text); + } + ca->mmi_state = MMI_STATE_MENU; + return 0; +} + +static int init_ca_stack(struct dvbca *ca) +{ + ca->tl = en50221_tl_create(1, 16); + if (ca->tl == NULL) { + dbgprintf(DEBUG_DVB, "Failed to create transport layer\n"); + return -1; + } + ca->sl = en50221_sl_create(ca->tl, 16); + if (ca->sl == NULL) { + dbgprintf(DEBUG_DVB, "Failed to create session layer\n"); + en50221_tl_destroy(ca->tl); + return -1; + } + + ca->stdcam = en50221_stdcam_llci_create(ca->fd, 0, ca->tl, ca->sl); + if (!ca->stdcam) { + dbgprintf(DEBUG_DVB, "Failed to create stdcam\n"); + en50221_sl_destroy(ca->sl); + en50221_tl_destroy(ca->tl); + return -1; + } + if (ca->stdcam->ai_resource) { + en50221_app_ai_register_callback(ca->stdcam->ai_resource, ai_callback, ca); + } + if (ca->stdcam->ca_resource) { + en50221_app_ca_register_info_callback(ca->stdcam->ca_resource, ca_info_callback, ca); + } + if (ca->stdcam->mmi_resource) { + en50221_app_mmi_register_close_callback(ca->stdcam->mmi_resource, mmi_close_callback, ca); + en50221_app_mmi_register_display_control_callback(ca->stdcam->mmi_resource, + mmi_display_control_callback, ca); + en50221_app_mmi_register_enq_callback(ca->stdcam->mmi_resource, mmi_enq_callback, ca); + en50221_app_mmi_register_menu_callback(ca->stdcam->mmi_resource, mmi_menu_callback, ca); + en50221_app_mmi_register_list_callback(ca->stdcam->mmi_resource, mmi_menu_callback, ca); + } else { + dbgprintf(DEBUG_DVB, + "CAM Menus are not supported by this interface hardware\n"); + } + return 0; +} + +static int init_ca(struct octoserve *os, int a, int f, int fd) +{ + struct dvbca *ca; + + ca = &os->dvbca[os->dvbca_num]; + ca->os = os; + ca->anum = a; + ca->fnum = f; + ca->nr = os->dvbca_num + 1; + ca->fd = fd; + pthread_mutex_init(&ca->mutex, 0); + + init_ca_stack(ca); + + pthread_create(&ca->poll_pt, NULL, (void *) ci_poll, ca); + pthread_create(&ca->pt, NULL, (void *) handle_ci, ca); + + os->dvbca_num++; + return 0; +} + +static int scan_dvbca(struct octoserve *os) +{ + int a, f, fd; + char fname[80]; + + for (a = 0; a < 16; a++) { + for (f = 0; f < 16; f++) { + sprintf(fname, "/dev/dvb/adapter%d/ca%d", a, f); + fd = open(fname, O_RDWR); + if (fd >= 0) { + init_ca(os, a, f, fd); + //close(fd); + } + } + } + dbgprintf(DEBUG_DVB, "Found %d CA interfaces\n", os->dvbca_num); +} + +void scif_config(struct octoserve *os, char *name, char *val) +{ + if (!name || !val) + return; + + if (!strncasecmp(name, "type", 4) && + val[0] >= 0x30 && val[0] <= 0x32) { + os->scif_type = val[0] - 0x30; + dbgprintf(DEBUG_DVB, "setting type = %d\n", os->scif_type); + } + if (!strncasecmp(name, "tuner", 5) && + name[5] >= 0x31 && name[5] <= 0x38) { + int fe = name[5] - 0x31; + char *end; + unsigned long int nr = strtoul(val, &end, 10), freq = 0; + + if (nr > 8) + return; + if (*end == ',') { + val = end + 1; + freq = strtoul(val, &end, 10); + if (val == end) + return; + } + if (nr == 0) + os->dvbfe[fe].scif_type = 0; + else { + os->dvbfe[fe].scif_slot = nr - 1; + os->dvbfe[fe].scif_freq = freq; + os->dvbfe[fe].scif_type = os->scif_type; + } + dbgprintf(DEBUG_DVB, "fe%d: type=%d, slot=%d, freq=%d\n", fe, + os->dvbfe[fe].scif_type, + os->dvbfe[fe].scif_slot, + os->dvbfe[fe].scif_freq); + } +} + + +void set_lnb(struct octoserve *os, int tuner, + uint32_t source, uint32_t lof1, uint32_t lof2, uint32_t lofs) +{ + int i, j; + int i1 = 0, i2 = MAX_DVB_FE; + int j1 = 0, j2 = MAX_SOURCE; + + if (tuner > MAX_DVB_FE) + return; + if (source > MAX_SOURCE) + return; + + if (tuner) { + i1 = tuner - 1; + i2 = i1 + 1; + } + if (source) { + j1 = source - 1; + j2 = j1 + 1; + } + for (i = i1; i < i2; i++) { + struct dvbfe *fe = &os->dvbfe[i]; + for (j = j1; j < j2; j++) { + dbgprintf(DEBUG_DVB, "setting %d %d %u %u %u\n", + i, j, lof1, lof2, lofs); + fe->lof1[j] = lof1; + fe->lof2[j] = lof2; + fe->lofs[j] = lofs; + fe->prev_delay[j] = 250000; + } + } +} + +void lnb_config(struct octoserve *os, char *name, char *val) +{ + static int lnb = -1; + static uint32_t lof1, lof2, lofs, tuner, source; + char *end; + + if (!name || !val) { + if (lnb >= 0) + set_lnb(os, tuner, source, + lof1 * 1000, lof2 * 1000, lofs * 1000); + lnb++; + tuner = source = lof1 = lof2 = lofs = 0; + return; + } + if (!strcasecmp(name, "tuner")) { + tuner = strtoul(val, &end, 10); + } else if (!strcasecmp(name, "source")) { + source = strtoul(val, &end, 10); + } else if (!strcasecmp(name, "lof1")) { + lof1 = strtoul(val, &end, 10); + } else if (!strcasecmp(name, "lof2")) { + lof2 = strtoul(val, &end, 10); + } else if (!strcasecmp(name, "lofs")) { + lofs = strtoul(val, &end, 10); + } +} + +int init_dvb(struct octoserve *os, int nodvbt, int noswitch) +{ + int i, j; + + pthread_mutex_init(&nsd_lock, 0); + pthread_mutex_init(&os->uni_lock, 0); + + scan_dvbfe(os, nodvbt, noswitch); + scan_dvbca(os); + + os->scif_type = 0; + parse_config(os, "scif", &scif_config); + + if (os->has_feswitch) { + uint32_t fmode = 0; + + if (os->do_feswitch) { + fmode = 1; + if (os->scif_type) + fmode = 3; + } + set_fmode(fmode); + } + set_lnb(os, 0, 0, 9750000, 10600000, 11700000); + parse_config(os, "LNB", &lnb_config); +} + +int release_dvb(struct octoserve *os) +{ + int i; + + for (i = 0; i < os->dvbfe_num; i++) { + + } + + for (i = 0; i < os->dvbca_num; i++) { + struct dvbca *ca = &os->dvbca[i]; + + pthread_join(ca->poll_pt, NULL); + pthread_join(ca->pt, NULL); + } + pthread_mutex_destroy(&nsd_lock); + pthread_mutex_destroy(&os->uni_lock); +} diff --git a/octoserve/gpl.txt b/octoserve/gpl.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/octoserve/gpl.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/octoserve/http.c b/octoserve/http.c new file mode 100644 index 0000000..e3bf090 --- /dev/null +++ b/octoserve/http.c @@ -0,0 +1,441 @@ +/* + (C) 2012-13 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#include "octoserve.h" + +char httpxml[] = + "HTTP/1.0 200 OK\r\nConnection: close\r\n" + "Content-Length: %d\r\nContent-Type: text/xml\r\nMime-Version: 1.0\r\n" + "\r\n"; + +char xmldesc[] = + "<\?xml version=\"1.0\"\?>\r\n" + "\r\n" + "\r\n1\r\n1\r\n\r\n" + "\r\n" + "urn:ses-com:device:SatIPServer:1\r\n" + "OctopusNet\r\n" + "DigitalDevices\r\n" + "http://www.digitaldevices.de/\r\n" + "OctopusNet\r\n" + "OctopusNet\r\n" + "1.0\r\n" + "http://www.digitaldevices.de/OctopusNet.html\r\n" + "%d\r\n" + "%s\r\n" + //"Universal Product Code\r\n" + "\r\n" + + "\r\nimage/png\r\n" + "120\r\n120\r\n" + "24\r\nwww/icons/dd-120.png\r\n" + "\r\n" + + "\r\nimage/jpg\r\n" + "120\r\n120\r\n" + "24\r\nwww/icons/dd-120.jpg\r\n" + "\r\n" + + "\r\nimage/png\r\n" + "48\r\n48\r\n" + "24\r\nwww/icons/dd-48.png\r\n" + "\r\n" + + "\r\nimage/jpg\r\n" + "48\r\n48\r\n" + "24\r\nwww/icons/dd-48.jpg\r\n" + "\r\n" + + "\r\n" + "../index.html\r\n" + "%s\r\n" + "\r\n" + "\r\n" + "\r\n"; + +char httpfile[] = + "HTTP/1.1 200 OK\r\nConnection: close\r\n" + "Content-Length: %d\r\n" + "Content-Type: %s\r\n" + "\r\n"; + +void send_http_error(int sock, int nr) +{ + char buf[2048], *str; + int len; + + if (nr == 404) + str = "Not Found"; + if (nr == 405) + str = "Method not allowed"; + + len = snprintf(buf, sizeof(buf), "HTTP/1.1 %d %s\r\nConnection: close\r\n\r\n", nr, str); + + if (len <= 0 || len >= sizeof(buf)) + return; + sendlen(sock, buf, len); +} + +static char *mtypes[] = { + "jpg", "image/jpeg", + "png", "image/png", + "html", "text/html", + NULL +}; + +void send_http_file(int sock, char *fn) +{ + uint8_t buf[1024]; + int len, len2, fd; + char fn2[1024] = { 0 }, *d, **m; + + strcat(fn2, "/var/satip"); + strcat(fn2, fn); + d = strrchr(fn, '.'); + if (d) { + printf("%s\n", d); + for (d++, m = &mtypes[0]; *m; m += 2) { + if (!strcmp(*m, d)) { + m++; + break; + } + } + d = *m; + } + if (!d) + d = "binary/octet-stream"; + + printf("open %s %s\n", fn2, d); + fd = open(fn2, O_RDONLY); + if (fd < 0) { + send_http_error(sock, 404); + return; + } + len = lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_SET); + len2 = sprintf(buf, httpfile, len, d); + sendlen(sock, buf, len2); + sendfile(sock, fd, 0, len); + close(fd); +} + +void send_xml(struct os_ssdp *ss) +{ + struct octoserve *os = ss->os; + uint8_t buf[2048], buf2[1024], cap[1024]; + int len, len2; + uint8_t *mac = &os->mac[0]; + int serial = (mac[5] | (mac[4] << 8) | (mac[3] << 16)) / 2; + + len = 0; + if (os->dvbs2num) + len += sprintf(cap + len, ",DVBS2-%u", os->dvbs2num); + if (os->dvbtnum) + len += sprintf(cap + len, ",DVBT-%u", os->dvbtnum); + if (os->dvbt2num) + len += sprintf(cap + len, ",DVBT2-%u", os->dvbt2num); + if (os->dvbcnum) + len += sprintf(cap + len, ",DVBC-%u", os->dvbcnum); + if (os->dvbc2num) + len += sprintf(cap + len, ",DVBC2-%u", os->dvbc2num); + len = snprintf(buf, sizeof(buf), xmldesc, + ss->configid, serial, ss->uuid_str, cap + 1); + if (len <= 0 || len >= sizeof(buf)) + return; + len2=sprintf(buf2, httpxml, len); + sendlen(ss->csock, buf2, len2); + sendlen(ss->csock, buf, len); + //printf("Send:\n%s", buf2); + //printf("%s\n", buf); +} + +char httptxt[] = + "HTTP/1.0 200 OK\r\nConnection: close\r\n" + "Content-Type: text/html\r\n" + "\r\n"; + +char httpjava[] = + "HTTP/1.0 200 OK\r\nConnection: close\r\nPragma: no-cache\r\n" + "Content-Type: application/x-javascript\r\n\r\n"; + +#define sendstr(_fd_,...) do { \ + len = snprintf(buf, sizeof(buf), __VA_ARGS__); \ + if (len <= 0 || len >= sizeof(buf)) \ + break; \ + sendlen(_fd_, buf, len); \ + } while (0); + +void send_serverinfo(struct os_ssdp *ss) +{ + struct octoserve *os = ss->os; + struct dvbfe *fe; + uint8_t buf[2048]; + int i, j, fd = ss->csock, len; + uint8_t *mac = &ss->os->mac[0]; + + sendlen(fd, httpjava, sizeof(httpjava) - 1); + sendstr(fd, "Octoserve = new Object();\r\n"); + sendstr(fd, "Octoserve.Version = \"" OCTOSERVE_VERSION "\";\r\n"); + sendstr(fd, "Octoserve.BootID = %u;\r\n", ss->bootid); + sendstr(fd, "Octoserve.DeviceID = %u;\r\n", ss->devid); + sendstr(fd, "Octoserve.MAC = \"%02x:%02x:%02x:%02x:%02x:%02x\";\r\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + sendstr(fd, "Octoserve.TunerList = new Array();\r\n"); + for (i = 0; i < MAX_DVB_FE; i++) { + struct dvbfe *fe = &os->dvbfe[i]; + + if (fe->type) { + char types[80]; + int pos; + + types[0] = 0; + if (fe->type & 0xb00ee) { + strcat(types, "DVB"); + pos = strlen(types); + if (fe->type & (1 << SYS_DVBS)) + strcat(types, "/S"); + if (fe->type & (1 << SYS_DVBS2)) + strcat(types, "/S2"); + if (fe->type & (1 << SYS_DVBC_ANNEX_A)) + strcat(types, "/C"); + if (fe->type & (1 << SYS_DVBC2)) + strcat(types, "/C2"); + if (fe->type & (1 << SYS_DVBT)) + strcat(types, "/T"); + if (fe->type & (1 << SYS_DVBT2)) + strcat(types, "/T2"); + strcat(types, " "); + types[pos] = '-'; + } + if (fe->type & 0x700) { + strcat(types, "ISDB"); + pos = strlen(types); + if (fe->type & (1 << SYS_ISDBT)) + strcat(types, "/T"); + if (fe->type & (1 << SYS_ISDBS)) + strcat(types, "/S"); + if (fe->type & (1 << SYS_ISDBC)) + strcat(types, "/C"); + types[pos] = '-'; + } + sendstr(fd, "Octoserve.TunerList[%d] = new Object();\r\n", i); + sendstr(fd, "Octoserve.TunerList[%d].Type = 0;\r\n", i); + sendstr(fd, "Octoserve.TunerList[%d].Desc = \"%s\";\r\n", i, types); + } else { + sendstr(fd, "Octoserve.TunerList[%d] = false;\r\n", i); + } + } +} + +void send_tunerstatus(struct os_ssdp *ss) +{ + struct octoserve *os = ss->os; + struct dvbfe *fe; + uint8_t buf[2048]; + int len, i, fd = ss->csock; + + sendlen(fd, httpjava, sizeof(httpjava) - 1); + sendstr(fd, "TunerList = new Array();\r\n"); + for (i = 0; i < MAX_DVB_FE; i++) { + fe = &os->dvbfe[i]; + sendstr(fd, "TunerList[%d] = new Object();\r\n", i); + sendstr(fd, "TunerList[%d].Active = %s;\r\n", i, fe->state ? "true" : "false"); + if (!fe->state) + continue; + sendstr(fd, "TunerList[%d].Lock = %s;\r\n", i, fe->lock ? "true" : "false"); + sendstr(fd, "TunerList[%d].Quality = %u;\r\n", i, fe->quality); + sendstr(fd, "TunerList[%d].Strength = %u;\r\n", i, fe->level); + } +} + +static uint32_t ddreg(int fd, uint32_t reg) +{ + struct ddb_reg ddr = { .reg = reg }; + + ioctl(fd, IOCTL_DDB_READ_REG, &ddr); + return ddr.val; +} + +static uint32_t ddrmem(int fd, uint8_t *buf, uint32_t off, uint32_t len) +{ + struct ddb_mem ddm = { .off = off, .buf = buf, .len = len }; + + return ioctl(fd, IOCTL_DDB_READ_MEM, &ddm); +} + +static void send_streamstatus(struct os_ssdp *ss) +{ + struct octoserve *os = ss->os; + struct osstrm *oss; + uint8_t buf[2048]; + int len, i, fd = ss->csock; + struct timeval tval; + struct timespec tp; + int dd; + + dd = open("/dev/ddbridge/card0", O_RDWR); /* FIXME: replace with ioctls */ + if (dd < 0) + return; + clock_gettime(CLOCK_MONOTONIC, &tp); + gettimeofday(&tval, NULL); + sendlen(fd, httpjava, sizeof(httpjava) - 1); + sendstr(fd, "TimeStamp = %d;\r\n", (uint32_t) (tp.tv_sec * 1000 + tp.tv_nsec / 1000000)); + sendstr(fd, "StreamList = new Array();\r\n"); + for (i = 0; i < MAX_STREAM; i++) { + uint32_t ctrl = ddreg(dd, 0x400 + i*0x20); + + sendstr(fd, "StreamList[%d] = new Object();\r\n", i); + sendstr(fd, "StreamList[%d].Status = \"%s\";\r\n", i, (ctrl & 1) ? "Active" : "Inactive"); + sendstr(fd, "StreamList[%d].Input = %d;\r\n", i, (ctrl >> 8) & 7); + sendstr(fd, "StreamList[%d].Packets = %d;\r\n", i, ddreg(dd, 0x41c + i*0x20)); + sendstr(fd, "StreamList[%d].Bytes = %d;\r\n", i, ddreg(dd, 0x418 + i*0x20)); + if (ctrl & 1) { + uint32_t off = 0x2000 + i * 0x200; + uint8_t mem[64]; + + ddrmem(dd, mem, off, sizeof(mem)); + off = 30; + if (mem[12] == 0x81) + off += 4; + sendstr(fd, "StreamList[%d].Client = \"%u.%u.%u.%u\";\r\n", i, + mem[off], mem[off + 1], mem[off + 2], mem[off + 3]); + } else + sendstr(fd, "StreamList[%d].Client = \"\";\r\n", i); + } + close(dd); +} + +static void send_octoserve(struct os_ssdp *ss) +{ + struct octoserve *os = ss->os; + struct dvbfe *fe; + uint8_t buf[2048], buf2[1024]; + int len, i; + + send(ss->csock, httptxt, sizeof(httptxt), 0); + for (i = 0; i < MAX_DVB_FE; i++) { + fe = &os->dvbfe[i]; + if (!fe->state) + continue; + len = snprintf(buf, sizeof(buf), "tuner%d: level=%d, quality=%d\r\n", + i, fe->level, fe->quality); + if (len <= 0 || len >= sizeof(buf)) + return; + send(ss->csock, buf, len, 0); + } +} + +void handle_http(struct os_ssdp *ss) +{ + int len; + uint8_t buf[2048]; + int p = 0; + + while (1) { + len = recv(ss->csock, buf + p, 2048 - p, 0); + if (!len) + return; + if (len > 0) { + p += len; + if (p > sizeof(buf)) { + send_http_error(ss->csock, 405); + break; + } + if (buf[p-4] == '\r' && buf[p-3] == '\n' && + buf[p-2] == '\r' && buf[p-1] == '\n') { + if (strncasecmp("GET ", buf, 4)) { + send_http_error(ss->csock, 405); + break; + } + if (!strncasecmp("GET /octonet.xml", buf, 16)) { + send_xml(ss); + break; + } else if (!strncasecmp("GET /serverinfo.js", buf, 18)) { + send_serverinfo(ss); + break; + } else if (!strncasecmp("GET /streamstatus.js", buf, 20)) { + send_streamstatus(ss); + break; + } else if (!strncasecmp("GET /tunerstatus.js", buf, 19)) { + send_tunerstatus(ss); + break; + } else { + int i = 3, j, fd; + + while (buf[i] == ' ') + i++; + j = i; + while (buf[j] && buf[j] != '\r' && buf[j] != ' ') + j++; + buf[j] = 0; + if (i == j) { + send_http_error(ss->csock, 404); + break; + } + send_http_file(ss->csock, buf + i); + } + break; + } + } + } + close(ss->csock); + return; +} + +static void http_loop(struct octoserve *os) +{ + struct os_http *http = &os->http; + int num; + int mfd; + fd_set fds; + struct timeval timeout; + + while (!os->exit) { + timeout.tv_sec = 1; + timeout.tv_usec = 0; + + FD_ZERO(&fds); + mfd = 0; + add_fd(http->sock, &mfd, &fds); + + num = select(mfd + 1, &fds, NULL, NULL, &timeout); + if (num < 0) + break; + if (FD_ISSET(http->sock, &fds)) { + socklen_t len; + pthread_t pt; + + http->csock = accept(http->sock, &http->cadr, &len); + //handle_http(http); + } + } +} + +int init_http(struct octoserve *os) +{ + struct os_http *http = &os->http; + + http->os = os; + http->sock = streamsock("8888", AF_INET, &http->sadr); + if (listen(http->sock, 10) < 0) { + printf("http listen error"); + return; + } + pthread_create(&os->http.pt, NULL, (void *) handle_http, os); +} diff --git a/octoserve/igmp.c b/octoserve/igmp.c new file mode 100644 index 0000000..05f85ab --- /dev/null +++ b/octoserve/igmp.c @@ -0,0 +1,255 @@ +/* + (C) 2012-13 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#include "octoserve.h" + +extern uint32_t debug; + +static uint16_t cs16(uint8_t *p, uint32_t len) +{ + uint32_t cs; + + cs = (p[0] << 8) | p[1]; + p += 4; + len -= 4; + for (; len > 0; len -= 2, p += 2) + cs += (p[0] << 8) | p[1]; + if (len) + cs += p[0]; + + while (cs >> 16) + cs = (cs & 0xffff) + (cs >> 16); + return ~cs; +} + +void proc_igmp(struct octoserve *os, uint8_t *b, int l, uint8_t *macheader) +{ + int hl = (b[0] & 0xf) * 4, pl, rl, i, j, ns, al; + uint8_t cmd, *r, *s, type, *p; + uint16_t n; + char sd[64], mc[256], *mac = 0; + uint16_t cs; + + if (macheader) + mac = macheader + 6; + if (hl + 1 > l) + return; + + //dump(b, l); + sprintf(sd, "%03d.%03d.%03d.%03d -> %03d.%03d.%03d.%03d", + b[12], b[13], b[14], b[15], + b[16], b[17], b[18], b[19]); + + p = b + hl; + pl = l - hl; + if (pl < 4) + return; + if (cs16(p, pl) != ((p[2] << 8) | p[3])) { + dbgprintf(DEBUG_IGMP, "IGMP CS error\n"); + if (debug & DEBUG_IGMP) + dump(b, l); + return; + } + + cmd = b[hl]; + switch (cmd) { + case 0x11: + { + uint32_t a1, a2; + uint8_t *s; + + if (pl < 12) + return; + dbgprintf(DEBUG_IGMP, "IGMP: query by %s\n", sd); + s = (uint8_t *) &(((struct sockaddr_in *) &os->ssdp.sadr)->sin_addr); + a1 = (b[12] << 24) | (b[13] << 16) | (b[14] << 8) | b[15]; + a2 = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3]; + dbgprintf(DEBUG_IGMP, "%08x < %08x ? %s\n", a1, a2, (a1 < a2) ? "yes" : "no"); + if (a1 < a2) { + /* somebody else with lower IP is already sending queries */ + os->igmp_mode = 3; + time(&os->igmp_time); + os->igmp_tag++; + os->igmp_timeout = b[hl + 1] / 10 + 1; + dbgprintf(DEBUG_IGMP, "IGMP slave, tag = %u, timeout = %u\n", + os->igmp_tag, os->igmp_timeout); + } else + dbgprintf(DEBUG_IGMP, "IGMP master, tag = %u, timeout = %u\n", + os->igmp_tag, os->igmp_timeout); + break; + } + case 0x12: + if (pl < 8) + return; + dbgprintf(DEBUG_IGMP, "IGMPV1: %s : %d.%d.%d.%d\n", sd, + b[hl + 4], b[hl + 5], b[hl + 6], b[hl + 7]); + mc_join(os, b + 12, mac, &b[hl + 4]); + break; + case 0x16: + if (pl < 8) + return; + dbgprintf(DEBUG_IGMP, "IGMPV2: %s : %d.%d.%d.%d\n", sd, + b[hl + 4], b[hl + 5], b[hl + 6], b[hl + 7]); + mc_join(os, b + 12, mac, &b[hl + 4]); + break; + case 0x17: + if (pl < 8) + return; + dbgprintf(DEBUG_IGMP, "IGMPL: %s : %d.%d.%d.%d\n", sd, + b[hl + 4], b[hl + 5], b[hl + 6], b[hl + 7]); + mc_leave(os, b + 12, &b[hl + 4]); + break; + case 0x22: + if (pl < 8) + return; + pl -= 8; + //dump(b + hl, l - hl); + n = (b[hl + 6] << 8) | b[hl + 7]; + dbgprintf(DEBUG_IGMP, "IGMPV3: %s, %d records:\n", sd, n); + for (i = 0, r = &b[hl + 8]; i < n; i++, r += rl, pl -= rl) { + if (pl < 4) + return; + ns = (r[2] << 8) | r[3]; + al = r[1] * 4; + rl = 8 + ns * 4 + al; + if (pl < rl) + return; + type = r[0]; + dbgprintf(DEBUG_IGMP, "type %d, %d sources, %d aux:\n", type, ns, al); + if (ns) { + dbgprintf(DEBUG_IGMP, "cannot handle sources\n"); + continue; + } + if (type == 2) { + dbgprintf(DEBUG_IGMP, "IGMPV3: %s subscribed to %d\n", sd, ns); + mc_join(os, b + 12, mac, &r[4]); + } + if (type == 4) { + dbgprintf(DEBUG_IGMP, "IGMPV3: %s, change to Exclude %d (Join)\n", + sd, ns); + mc_join(os, b + 12, mac, &r[4]); + } + if (type == 3) { + dbgprintf(DEBUG_IGMP, "IGMPV3: %s, change to Include %d (Leave)\n", + sd, ns); + mc_leave(os, b + 12, &r[4]); + } + //printf("MC: %d.%d.%d.%d\n", r[4], r[5], r[6], r[7]); + for (j = 0, s = &r[8]; j < ns; j++, s += 4) { + dbgprintf(DEBUG_IGMP, "%d.%d.%d.%d\n", s[0], s[1], s[2], s[3]); + } + } + break; + } + //dump(b + hl, l - hl); +} + +static void calc_cs(uint8_t *m, uint32_t len) +{ + uint32_t cs = 0, i; + + for (i = 0; i < len - 1; i += 2) + cs += (m[i] << 8) | m[i + 1]; + if (i < len) + cs += m[i] << 8; + cs = (cs >> 16) + (cs & 0xffff); + cs = (cs >> 16) + (cs & 0xffff); + cs ^= 0xffff; + m[2] = cs >> 8; + m[3] = cs & 0xff; +} + +void send_igmp_query(struct octoserve *os, uint8_t *group, uint8_t timeout) +{ + uint8_t msg[] = { 0x11, 0x64, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x02, 0x7d, 0x00, 0x00 + }; + struct sockaddr_in insadr; + uint8_t zero = 0, ra[4] = { 0x94, 0x04, 0x00, 0x00 }; + + memset(&insadr, 0, sizeof(insadr)); + insadr.sin_family = AF_INET; + insadr.sin_port = IPPROTO_IGMP; + //insadr.sin_addr.s_addr = inet_addr("224.0.0.22"); + insadr.sin_addr.s_addr = inet_addr("224.0.0.1"); + + if (group) { + msg[4] = group[0]; + msg[5] = group[1]; + msg[6] = group[2]; + msg[7] = group[3]; + memcpy(&insadr.sin_addr.s_addr, group, 4); + } + if (timeout) + msg[1] = timeout; + + calc_cs(msg, sizeof(msg)); + + setsockopt(os->igmp_sock, IPPROTO_IP, IP_OPTIONS, ra, sizeof(ra)); + sendto(os->igmp_sock, msg, sizeof(msg), 0, (struct sockaddr *) &insadr, sizeof(insadr)); + dbgprintf(DEBUG_IGMP, "Queried group %03u.%03u.%03u.%03u\n", + msg[4], msg[5], msg[6], msg[7]); +} + +void check_igmp(struct octoserve *os) +{ + time_t tdiff, t; + + tdiff = time(&t) - os->igmp_time; + switch (os->igmp_mode) { + case 0: + if (tdiff > 124) { + os->igmp_timeout = 11; + dbgprintf(DEBUG_IGMP, + "%u: IGMP master query, tag = %u, timeout = %u\n", + t, os->igmp_tag, os->igmp_timeout); + os->igmp_tag++; + send_igmp_query(os, 0, 0); + os->igmp_time = t; + os->igmp_mode = 1; + if (os->igmp_robust) { + os->igmp_robust--; + os->igmp_time -= 94; + } + } + break; + case 1: + if (tdiff > os->igmp_timeout) { + dbgprintf(DEBUG_IGMP, "%u: IGMP timeout, tag = %u\n", t, os->igmp_tag); + os->igmp_mode = 0; + } + break; + case 2: + /* check if query master timed out */ + if (tdiff < 255) + return; + /* yes, so we will have to query from now on */ + os->igmp_mode = 0; + os->igmp_time = t - 94; + os->igmp_robust = 1; + break; + case 3: + if (tdiff > os->igmp_timeout) { + dbgprintf(DEBUG_IGMP, "%u: IGMP timeout, tag = %u\n", t, os->igmp_tag); + os->igmp_mode = 2; + } + break; + } +} diff --git a/octoserve/ns.h b/octoserve/ns.h new file mode 100644 index 0000000..691c65d --- /dev/null +++ b/octoserve/ns.h @@ -0,0 +1,68 @@ +#ifndef _UAPI_DVBNS_H_ +#define _UAPI_DVBNS_H_ + +#include + +struct dvb_ns_params { + __u8 smac[6]; + __u8 dmac[6]; + __u8 sip[16]; + __u8 dip[16]; + __u16 sport; + __u16 dport; + __u16 sport2; + __u16 dport2; + __u8 ssrc[8]; + __u8 flags; + __u8 qos; + __u16 vlan; + __u8 ttl; +}; + +#define DVB_NS_IPV6 1 +#define DVB_NS_RTP 2 +#define DVB_NS_RTCP 4 +#define DVB_NS_RTP_TO 8 + +struct dvb_ns_rtcp { + __u8 *msg; + __u16 len; +}; + +struct dvb_ns_packet { + __u8 *buf; + __u8 count; +}; + +struct dvb_nsd_ts { + __u16 pid; + __u16 num; + __u16 input; + __u16 timeout; + __u16 len; + __u8 *ts; + __u8 mode; + __u8 table; + + __u8 filter_mask; + __u8 section; + __u16 section_id; +}; + +#define NS_SET_NET _IOW('o', 192, struct dvb_ns_params) +#define NS_START _IO('o', 193) +#define NS_STOP _IO('o', 194) +#define NS_SET_PID _IOW('o', 195, __u16) +#define NS_SET_PIDS _IOW('o', 196, __u8 *) +#define NS_SET_RTCP_MSG _IOW('o', 197, struct dvb_ns_rtcp) + +#define NSD_START_GET_TS _IOWR('o', 198, struct dvb_nsd_ts) +#define NSD_STOP_GET_TS _IOWR('o', 199, struct dvb_nsd_ts) +#define NSD_CANCEL_GET_TS _IO('o', 200) +#define NSD_POLL_GET_TS _IOWR('o', 201, struct dvb_nsd_ts) + +#define NS_SET_PACKETS _IOW('o', 202, struct dvb_ns_packet) +#define NS_INSERT_PACKETS _IOW('o', 203, __u8) +#define NS_SET_CI _IOW('o', 204, __u8) + +#endif /*_UAPI_DVBNS_H_*/ diff --git a/octoserve/ntools.c b/octoserve/ntools.c new file mode 100644 index 0000000..f19548b --- /dev/null +++ b/octoserve/ntools.c @@ -0,0 +1,140 @@ +/* + (C) 2012-13 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#include "octoserve.h" + +int streamsock(const char *port, int family, struct sockaddr *sadr) +{ + int one=1, sock; + struct addrinfo *ais, *ai, hints = { + .ai_flags = AI_PASSIVE, + .ai_family = family, + .ai_socktype = SOCK_STREAM, + .ai_protocol = 0, .ai_addrlen = 0, + .ai_addr = NULL, .ai_canonname = NULL, .ai_next = NULL, + }; + if (getaddrinfo(NULL, port, &hints, &ais) < 0) + return -1; + for (ai = ais; ai; ai = ai->ai_next) { + sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); + if (sock == -1) + continue; + if (!setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) && + !bind(sock, ai->ai_addr, ai->ai_addrlen)) { + *sadr = *ai->ai_addr; + break; + } + close(sock); + sock = -1; + } + freeaddrinfo(ais); + return sock; +} + +void sockname(struct sockaddr *sadr, char *name) +{ + void *adr; + char *unknown = "unknown"; + + strcpy(name, unknown); + if (sadr->sa_family == AF_INET) + adr = &((struct sockaddr_in *) sadr)->sin_addr; + else if (sadr->sa_family == AF_INET6) + adr = &((struct sockaddr_in6 *) sadr)->sin6_addr; + else + return; + inet_ntop(sadr->sa_family, adr, name, INET6_ADDRSTRLEN); + + printf("sockname: %s\n", name); +} + +int get_ifa(const char *ifname, int iffam, struct sockaddr *sadr) +{ + struct ifaddrs *ifaddrs, *ifa; + + if (getifaddrs(&ifaddrs) == -1) + return -1; + for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) { + if (!ifa->ifa_addr) + continue; + if (ifa->ifa_addr->sa_family != iffam) + continue; + if (strcmp(ifname, ifa->ifa_name)) + continue; + *sadr = *ifa->ifa_addr; +#if 1 + { + void *adr; + char buf[INET6_ADDRSTRLEN]; + + if (ifa->ifa_addr->sa_family == AF_INET) + adr = &((struct sockaddr_in *) ifa->ifa_addr)->sin_addr; + else + adr = &((struct sockaddr_in6 *) ifa->ifa_addr)->sin6_addr; + inet_ntop(ifa->ifa_addr->sa_family, adr, buf, sizeof(buf)); + printf("get_ifa %s:%s\n", ifname, buf); + } +#endif + freeifaddrs(ifaddrs); + return 0; + } + freeifaddrs(ifaddrs); + return -1; +} + + +void sadr2str(const struct sockaddr *sadr, char *s, size_t len) +{ + switch(sadr->sa_family) { + case AF_INET: + inet_ntop(AF_INET, + &(((struct sockaddr_in *)sadr)->sin_addr), s, len); + break; + + case AF_INET6: + inet_ntop(AF_INET6, + &(((struct sockaddr_in6 *)sadr)->sin6_addr), s, len); + break; + } +} + +int sendlen(int sock, char *buf, int len) +{ + int done, todo; + + for (todo = len; todo; todo -= done, buf += done) + if ((done = send(sock, buf, todo, 0)) < 0) + return done; + return len; +} + +int sendstring(int sock, char *fmt, ...) +{ + int len; + uint8_t buf[2048]; + va_list args; + + va_start(args, fmt); + len = vsnprintf(buf, sizeof(buf), fmt, args); + if (len <= 0 || len >= sizeof(buf)) + return; + sendlen(sock, buf, len); + va_end(args); +} + diff --git a/octoserve/octoserve.c b/octoserve/octoserve.c new file mode 100644 index 0000000..f1ec33a --- /dev/null +++ b/octoserve/octoserve.c @@ -0,0 +1,2596 @@ +/* + (C) 2012-14 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#include "octoserve.h" + +#include + +uint32_t debug; + +void dump(const uint8_t *b, int l) +{ + int i, j; + + for (j = 0; j < l; j += 16, b += 16) { + for (i = 0; i < 16; i++) + if (i + j < l) + printf("%02x ", b[i]); + else + printf(" "); + printf(" | "); + for (i = 0; i < 16; i++) + if (i + j < l) + putchar((b[i] > 31 && b[i] < 127) ? b[i] : '.'); + printf("\n"); + } +} + +static void update_switch_vec(struct ossess *sess) +{ + struct osmcc *mcc; + uint32_t vec = 0; + + for (mcc = sess->mccs.lh_first; mcc; mcc = mcc->mcc.le_next) + vec |= mcc->port_vec; + if (vec != sess->mcc_port_vec_set || sess->port_vec != sess->port_vec_set) { + sess->mcc_port_vec_set = vec; + sess->port_vec_set = sess->port_vec; + switch_set_multicast(sess->trans.mcmac, + sess->mcc_port_vec_set | sess->port_vec_set); + } +} + +struct rtsp_error rtsp_errors[] = { + {100, "Continue"}, + {200, "OK"}, + {400, "Bad Request"}, + {403, "Forbidden"}, + {404, "Not Found"}, + {405, "Method Not Allowed"}, + {406, "Not Acceptable"}, + {408, "Request Timeout"}, + {414, "Request-URI Too Long"}, + {453, "Not Enough Bandwidth"}, + {454, "Session Not Found"}, + {455, "Method Not Valid in This State"}, + {461, "Unsupported Transport"}, + {500, "Internal Server Error"}, + {501, "Not Implemented"}, + {503, "Service Unavailable"}, + {505, "Version Not Supported"}, + {551, "Option Not Supported"}, + {0, ""}, +}; + +static int adrtoip(struct sockaddr *sa, uint8_t *ip) +{ + unsigned short af = sa->sa_family; + void *adr; + + if (af == AF_INET) + adr = &((struct sockaddr_in *) sa)->sin_addr; + else if (af == AF_INET6) + adr = &((struct sockaddr_in6 *) sa)->sin6_addr; + else + return -1; + memcpy(ip, adr, af == AF_INET ? 4 : 16); + return 0; +} + +static int check_self(struct sockaddr *sadr, uint8_t *mac) +{ + uint8_t ip[16]; + + if (adrtoip(sadr, ip) < 0) + return -1; +} + +static int get_mac(char *ifname, struct sockaddr *sadr, uint8_t *mac) +{ + struct arpreq arpreq; + int s; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + return -1; + memset(&arpreq, 0, sizeof(struct arpreq)); + memcpy(&arpreq.arp_pa, sadr, sizeof(struct sockaddr)); + + arpreq.arp_ha.sa_family = ARPHRD_ETHER; + strcpy(arpreq.arp_dev, ifname); + if (ioctl(s, SIOCGARP, &arpreq) < 0) { + perror("get_mac socket error on"); + dump((uint8_t *)sadr, sizeof(struct sockaddr)); + close(s); + return -1; + } + close(s); + memcpy(mac, arpreq.arp_ha.sa_data, 6); + dbgprintf(DEBUG_NET, "%s=%02x:%02x:%02x:%02x:%02x:%02x\n", ifname, + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + return 0; +} + +static int ip2mac(uint8_t *ip, uint8_t *mac) +{ + struct arpreq arpreq; + struct sockaddr_in *sin = (struct sockaddr_in *) &arpreq.arp_pa; + int s; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + return -1; + memset(&arpreq, 0, sizeof(struct arpreq)); + sin->sin_family = AF_INET; + memcpy(&sin->sin_addr.s_addr, ip, 4); + + if (ioctl(s, SIOCGARP, &arpreq) < 0) { + perror("ip2mac socket error"); + close(s); + return -1; + } + close(s); + memcpy(mac, arpreq.arp_ha.sa_data, 6); + dbgprintf(DEBUG_NET, "%u.%u.%u.%u=%02x:%02x:%02x:%02x:%02x:%02x\n", + ip[0], ip[1], ip[2], ip[3], + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + return 0; +} + +static void add_fd(int fd, int *mfd, fd_set *fds) +{ + FD_SET(fd, fds); + if (fd > *mfd) + *mfd = fd; +} + +int readmii(int id, int reg) +{ + int fd; + struct ifreq ifr; + struct mii_ioctl_data *mii = (struct mii_ioctl_data *) &ifr.ifr_data; + + strcpy(ifr.ifr_name, "eth0"); + mii->phy_id = id; + mii->reg_num = reg; + mii->val_in = 0; + mii->val_out = 0; + fd = socket(AF_INET, SOCK_DGRAM, 0); + ioctl(fd, SIOCGMIIREG, &ifr); + dbgprintf(DEBUG_NET, "mii %02x.%02x = %02x\n", id, reg, mii->val_out); +} + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +void send_error(struct oscon *con, int err) +{ + uint8_t buf[256]; + int len; + char *err_str; + struct rtsp_error *rerr; + + for (rerr = rtsp_errors; rerr->number; rerr++) + if (rerr->number == err) + break; + if (!rerr->number) { + printf("Internal Error: invalid error number %d\n", err); + return; + } + len=sprintf(buf, + "RTSP/1.0 %d %s\r\n" + "CSeq: %d\r\n" + "\r\n", err, rerr->name, con->seq); + sendlen(con->sock, buf, len); + dbgprintf(DEBUG_RTSP, "Send Error:\n%s\n", buf); +} + +static void *release_session(struct ossess *oss); + +static void *release_ca(struct dvbca *ca) +{ + dbgprintf(DEBUG_SYS, "release ca %d\n", ca->nr); + pthread_mutex_lock(&ca->os->lock); + ca->stream->ca = NULL; + ca->state = 0; + pthread_mutex_unlock(&ca->os->lock); +} + +static struct dvbca *alloc_ca_num(struct osstrm *str, int num) +{ + struct octoserve *os = str->os; + struct dvbca *ca; + + if (num >= os->dvbca_num) + return NULL; + pthread_mutex_lock(&os->lock); + ca = &os->dvbca[num]; + if (ca->state == 0) { + printf("alloced ca %d\n", num); + pthread_mutex_lock(&ca->mutex); + memset(ca->pmt, 0, sizeof(ca->pmt)); + ca->state = 1; + ca->stream = str; + ca->input = str->fe->nr - 1; + pthread_mutex_unlock(&ca->mutex); + pthread_mutex_unlock(&os->lock); + return ca; + } + pthread_mutex_unlock(&os->lock); + return NULL; +} + +static struct dvbca *alloc_ca(struct osstrm *str) +{ + struct octoserve *os = str->os; + struct dvbca *ca; + uint32_t i; + + printf("alloc ca\n"); + pthread_mutex_lock(&os->lock); + for (i = 0; i < os->dvbca_num; i++) { + ca = &os->dvbca[i]; + if (ca->state == 0) { + printf("alloced ca %d\n", i); + pthread_mutex_lock(&ca->mutex); + memset(ca->pmt, 0, sizeof(ca->pmt)); + ca->state = 1; + ca->stream = str; + ca->input = str->fe->nr - 1; + pthread_mutex_unlock(&ca->mutex); + pthread_mutex_unlock(&os->lock); + return ca; + + } + } + pthread_mutex_unlock(&os->lock); + return NULL; +} + +static void *release_fe(struct octoserve *os, struct dvbfe *fe) +{ + if (!fe) + return; + dbgprintf(DEBUG_SYS, "release fe %d\n", fe->nr); + fe->state = 2; + pthread_join(fe->pt, NULL); +} + +static struct dvbfe *alloc_fe_num(struct octoserve *os, int i, int type) +{ + struct dvbfe *fe; + + if (i > os->dvbfe_num) + return NULL; + dbgprintf(DEBUG_SYS, "alloc_fe_num %d\n", i); + pthread_mutex_lock(&os->lock); + fe = &os->dvbfe[i]; + if (fe->state || !(fe->type & (1UL << type))) { + pthread_mutex_unlock(&os->lock); + return NULL; + } + fe->n_tune = 0; + fe->state = 1; + pthread_create(&fe->pt, NULL, (void *) handle_fe, fe); + pthread_mutex_unlock(&os->lock); + dbgprintf(DEBUG_SYS, "Allocated fe %d = %d/%d, fd=%d\n", + fe->nr, fe->anum, fe->fnum, fe->fd); + return fe; +} + +static struct dvbfe *alloc_fe(struct octoserve *os, int type) +{ + int i; + struct dvbfe *fe; + + pthread_mutex_lock(&os->lock); + for (i = 0; i < os->dvbfe_num; i++) { + fe = &os->dvbfe[i]; + if (fe->state == 0 && + (fe->type & (1UL << type))) { + pthread_mutex_unlock(&os->lock); + return alloc_fe_num(os, i, type); + } + } + pthread_mutex_unlock(&os->lock); + return NULL; +} + +static void *release_stream(struct osstrm *str) +{ + struct octoserve *os = str->os; + int i; + dbgprintf(DEBUG_SYS, "release stream %d\n", str->nr); + + for (i = 0; i < MAX_SESSION; i++) { + if (os->session[i].state && + os->session[i].stream == str) + os->session[i].stream = 0; + } + str->state = 0; + release_fe(os, str->fe); + if (str->ca) + release_ca(str->ca); +} + +static struct osstrm *alloc_stream(struct octoserve *os) +{ + int i; + struct osstrm *str; + + pthread_mutex_lock(&os->lock); + for (i = 0; i < MAX_STREAM; i++) { + str = &os->stream[i]; + if (str->state == 0) { + memset(str, 0, sizeof(struct osstrm)); + str->os = os; + str->nr = i + 1; + str->state = 1; + str->sport = 8000 + 2 * i; + str->sport2 = 8000 + 2 * i + 1; + pthread_mutex_unlock(&os->lock); + dbgprintf(DEBUG_SYS, "Allocated stream %d\n", str->nr); + return str; + } + } + pthread_mutex_unlock(&os->lock); + return NULL; +} + +static struct osstrm *get_stream(struct octoserve *os, int id) +{ + int i; + struct osstrm *str, *r = NULL; + + pthread_mutex_lock(&os->lock); + for (i = 0; i < MAX_STREAM; i++) { + str = &os->stream[i]; + if (str->state && str->nr == id) { + r = str; + break; + } + } + pthread_mutex_unlock(&os->lock); + return r; +} + +static void *release_session(struct ossess *oss) +{ + struct octoserve *os = oss->os; + int i; + + dbgprintf(DEBUG_SYS, "release session nr %d id %010d\n", oss->nr, oss->id); + pthread_mutex_lock(&os->lock); + mc_del(oss); + if (oss->stream) { + if (oss->stream->session == oss) + release_stream(oss->stream); + } + for (i = 0; i < MAX_CONNECT; i++) { + if (os->con[i].state && + os->con[i].session == oss) + os->con[i].session = 0; + } + if (oss->nsfd >= 0) { + dbgprintf(DEBUG_SYS, "close NS\n"); + close(oss->nsfd); + } + oss->playing = 0; + oss->state = 0; + pthread_mutex_unlock(&os->lock); +} + +static struct ossess *get_session(struct octoserve *os, uint32_t id) +{ + int i; + struct ossess *oss; + + pthread_mutex_lock(&os->lock); + for (i = 0; i < MAX_SESSION; i++) { + oss = &os->session[i]; + if (oss->state && oss->id == id) { + pthread_mutex_unlock(&os->lock); + return oss; + } + } + pthread_mutex_unlock(&os->lock); + return NULL; +} + +static void check_mccs(struct ossess *sess) +{ + time_t tdiff, t; + + if (!sess->trans.mcast) + return; + + tdiff = time(&t) - sess->mcc_time; + switch (sess->mcc_state) { + case 1: + if (tdiff >= 1) { + sess->mcc_state = 2; + /* all replying clients get new tag */ + sess->mcc_tag++; + send_igmp_query(sess->os, sess->trans.mcip, 10); + sess->mcc_time = t; + printf("%u: mcc_state 1 done, tag = %d\n", t, sess->mcc_tag); + } + break; + case 2: + if (tdiff >= 1) { + sess->mcc_state = 3; + send_igmp_query(sess->os, sess->trans.mcip, 10); + printf("%u: mcc_state 2 done, tag = %d\n", t, sess->mcc_tag); + } + break; + case 3: + if (tdiff >= 4) { + sess->mcc_state = 0; + sess->mcc_time = t; + printf("%u: mcc_state 2 done, tag = %d\n", t, sess->mcc_tag); + } + break; + case 0: + break; + } + mc_check(sess); +} + +void session_timeout(struct ossess *sess) +{ + time(&sess->timeout); + sess->timeout += sess->timeout_len; + dbgprintf(DEBUG_RTSP, "new timeout %d\n", sess->timeout); +} + +void check_session_timeouts(struct octoserve *os) +{ + time_t t; + int i; + struct ossess *sess; + + time(&t); + pthread_mutex_lock(&os->lock); + for (i = 0; i < MAX_SESSION; i++) { + sess = &os->session[i]; + check_mccs(sess); + + if (sess->state && + sess->timeout < t) { + struct oscon *con; + int j; + + /* also count open connections referencing this session, + for VLC, mplayer, ... which do not send keep alives */ + for (j = 0; j < MAX_CONNECT; j++) { + con = &os->con[j]; + if (con->state && con->session && + con->session == sess) { + session_timeout(sess); + break; + } + } + if (j == MAX_CONNECT) + release_session(&os->session[i]); + } + } + pthread_mutex_unlock(&os->lock); +} + +static uint32_t get_id(struct octoserve *os) +{ + uint32_t id, i; + struct ossess *oss; + + while (1) { + id = random(); + for (i = 0; i < MAX_SESSION; i++) { + oss = &os->session[i]; + if (oss->state && oss->id == id) + break; + } + if (i == MAX_SESSION) + return id; + } +} + +static struct ossess *alloc_session(struct octoserve *os) +{ + int i; + struct ossess *oss; + + pthread_mutex_lock(&os->lock); + for (i = 0; i < MAX_SESSION; i++) { + oss = &os->session[i]; + if (oss->state == 0) { + memset(oss, 0, sizeof(struct ossess)); + oss->os = os; + oss->nr = i; + oss->id = get_id(os); + os->sessionid++; + oss->state = 1; + oss->nsfd = -1; + oss->timeout_len = 60; + session_timeout(oss); + LIST_INIT(&oss->mccs); + time(&oss->mcc_time); + dbgprintf(DEBUG_SYS, + "Allocated session nr=%d id=%d\n", + oss->nr, oss->id); + pthread_mutex_unlock(&os->lock); + return oss; + } + } + pthread_mutex_unlock(&os->lock); + return NULL; +} + +static void *release_con(struct oscon *con) +{ + close(con->sock); + con->state = 0; + dbgprintf(DEBUG_SYS, "released con %d\n", con->nr); +} + +static struct oscon *alloc_con(struct octoserve *os) +{ + int i; + struct oscon *con; + + for (i = 0; i < MAX_CONNECT; i++) { + con = &os->con[i]; + if (con->state == 0) { + memset(con, 0, sizeof(struct oscon)); + con->os = os; + con->nr = i; + con->state = 1; + return con; + } + } + return NULL; +} + +int die(char *msg) +{ + printf("%s\n", msg); + exit(-1); +} + +void sigchld_handler(int s) +{ + while (wait(NULL) > 0); +} + +static void send_option(struct oscon *con) +{ + uint8_t buf[256], opt[256] ={ 0 }; + int len; + + if (con->session) + snprintf(opt, sizeof(opt), "Session: %010d\r\n", con->session->id); + + len = snprintf(buf, sizeof(buf), + "RTSP/1.0 200 OK\r\n" + "CSeq: %d\r\n" + "Public: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN\r\n" + "%s" + "\r\n", + con->seq, opt); + if (len > 0 && len < sizeof(buf)) { + sendlen(con->sock, buf, len); + dbgprintf(DEBUG_RTSP, "Send: %s\n", buf); + } +} + +char *pol2str[] = {"", "v", "h", "r", "l", NULL}; +char *msys2str [] = {"", "undef", "dvbc", "dvbcb", "dvbt", "dss", "dvbs", "dvbs2", "dvbh", + "isdbt", "isdbs", "isdbc", "atsc", "atscmh", "dtmb", "cmmb", "dab", + "dvbt2", "turbo", "dvbcc", "dvbc2", NULL}; +char *mtype2str [] = {"", "qpsk", "16qam", "32qam", + "64qam", "128qam", "256qam", + "autoqam", "8vsb", "16vsb", "8psk", + "16apsk", "32apsk", "dqpsk", "4qamnr", NULL}; +char *pilot2str [] = {"", "on", "off", "auto", NULL}; +char *roll2str [] = {"", "0.35", "0.20", "0.25", NULL}; +char *fec2str [] = {"", "none", "12", "23", "34", "56", "78", "89", "35", "45", "910", "25", NULL}; +char *bw2str [] = {"", "8", "7", "6", "auto", "5", "10", "1.712", NULL }; +char *tmode2str [] = { "", "2k", "8k", "auto", "4k", "1k", "16k", "32k", "c1", "c3780", NULL}; +char *gi2str [] = { "", "132", "116", "18", "14", "auto", "1128", "19128", "19256", "pn420", "pn595", "pn945", NULL}; +char *num2str [] = {"", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL}; + +#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) + +static int session_string(struct ossess *sess, char *msg, int mlen) +{ + struct dvbfe *fe; + char pids[512]; + struct dvb_params *p; + int pid, len, len2, plen; + int level = 0, lock = 0, quality = 0, tuner = 0; + int all; + struct osstrm *str = sess->stream; + + if (!sess->state || !str) + return -1; + if (str->fe){ + level = str->fe->level; + lock = str->fe->lock; + quality = str->fe->quality; + tuner = str->fe->nr; + } + p = &sess->p; + + for (pid = 0, all = 1; pid < 1024; pid++) { + if (p->pid[pid] != 0xff) { + all = 0; + break; + } + } + if (all) + snprintf(pids, sizeof(pids), "=all"); + else { + for (pid = 0, plen = 0; pid < 8192; pid++) { + if (p->pid[pid >> 3] & (1 << (pid & 7))) { + len2 = snprintf(pids + plen, sizeof(pids) - plen, + ",%u", pid); + if (len2 < 0) + return -1; + if (plen + len2 >= 200) + break; + plen += len2; + } + } + pids[0] = '='; + if (!plen) + snprintf(pids, sizeof(pids), "=none"); + } + + switch(p->param[PARAM_MSYS] - 1) { + case SYS_DVBS: + case SYS_DVBS2: + len = snprintf(msg, mlen, + "ver=1.0;src=%u;tuner=%u,%u,%u,%u,%u,%s,%s,%s,%s,%s,%u,%s;pids%s", + p->param[PARAM_SRC], tuner, + level, lock, quality, + p->param[PARAM_FREQ] / 1000, + pol2str[p->param[PARAM_POL]], + msys2str[p->param[PARAM_MSYS]], + mtype2str[p->param[PARAM_MTYPE]], + pilot2str[p->param[PARAM_PLTS]], + roll2str[p->param[PARAM_RO]], + p->param[PARAM_SR], + fec2str[p->param[PARAM_FEC]], + pids); + break; + case SYS_DVBT: + case SYS_DVBT2: + len = snprintf(msg, mlen, + "ver=1.1;tuner=%u,%u,%u,%u,%u.%03u,%s,%s,%s,%s,%s,%s,%u,%u,%u;pids%s", + tuner, level, lock, quality, + p->param[PARAM_FREQ] / 1000, + p->param[PARAM_FREQ] % 1000, + bw2str[p->param[PARAM_BW]], + msys2str[p->param[PARAM_MSYS]], + tmode2str[p->param[PARAM_TMODE]], + mtype2str[p->param[PARAM_MTYPE]], + gi2str[p->param[PARAM_GI]], + fec2str[p->param[PARAM_FEC]], + p->param[PARAM_PLP], + p->param[PARAM_T2ID], + p->param[PARAM_SM], + pids); + break; + case SYS_DVBC_ANNEX_A: + case (SYS_DVBC_ANNEX_C + 1): +#if 0 + len = snprintf(msg, mlen, + "ver=0.9;tuner=%u,%u,%u,%u,%u.%03u,%u,%s,%s;pids%s", + tuner, level, lock, quality, + p->param[PARAM_FREQ] / 1000, + p->param[PARAM_FREQ] % 1000, + p->param[PARAM_SR], + msys2str[p->param[PARAM_MSYS]], + mtype2str[p->param[PARAM_MTYPE]], + pids); +#else + len = snprintf(msg, mlen, + "ver=1.2;tuner=%u,%u,%u,%u,%u.%03u,%u,%s,%s,%u,%u,%u,%u;pids%s", + tuner, level, lock, quality, + p->param[PARAM_FREQ] / 1000, + p->param[PARAM_FREQ] % 1000, + p->param[PARAM_BW_HZ] / 1000000, + msys2str[p->param[PARAM_MSYS]], + mtype2str[p->param[PARAM_MTYPE]], + p->param[PARAM_SR], + p->param[PARAM_C2TFT], + p->param[PARAM_DS], + p->param[PARAM_PLP], + pids); +#endif + break; + } + + if (len >= mlen) + return -1; + return len; +} + +static int send_describe(struct oscon *con, int only) +{ + struct osstrm *str; + struct ostrans *t; + uint8_t buf[4096], buf2[1024], buf3[1024]; + int len, len2, i; + int start = 0, end = MAX_STREAM; + char *p; + + p = con->url; + while (*p && *p != ' ') + p++; + *p = 0; + +#if 1 + for (i = 0; i < MAX_STREAM; i++) { + str = &con->os->stream[i]; + if (str->state) + break; + } + if (i == MAX_STREAM) + return -404; +#endif + if (only >= 0) { + start = only - 1; + end = only; + } + len = snprintf(buf, sizeof(buf), + "v=0\r\n" + "o=- 5678901234 1 IN %s %s\r\n" + "s=SatIPServer:1 %d,%d,%d\r\n" + "t=0 0\r\n", + con->trans.family == AF_INET ? "IP4" : "IP6", + con->sadr_ip, + con->os->dvbs2num, + con->os->dvbtnum + con->os->dvbt2num, + con->os->dvbcnum + con->os->dvbc2num + ); + if (len <= 0 || len >= sizeof(buf)) + return -500; + for (i = start; i < end; i++) { + char *adr = "0.0.0.0", abuf[32]; + int alen; + + str = &con->os->stream[i]; + if (!str->state) + continue; + t = &str->session->trans; + + session_string(str->session, buf3, sizeof(buf3)); + + if (t->mcast) { + alen = snprintf(abuf, sizeof(abuf), + "%d.%d.%d.%d/%u", + t->mcip[0], + t->mcip[1], + t->mcip[2], + t->mcip[3], + t->ttl); + if (alen < 0) + return -500; + adr = abuf; + } + + len2 = snprintf(buf + len, sizeof(buf) - len, + "m=video %d %s 33\r\n" + "c=IN %s %s\r\n" + "a=control:stream=%d\r\n" + "a=fmtp:33 %s\r\n" + "a=%s\r\n", + t->mcast ? t->cport : 0, + t->rtp ? "RTP/AVP" : "UDP", + t->family == AF_INET ? "IP4" : "IP6", + adr, + str->nr, + buf3, + str->session->playing ? "sendonly" : "inactive" + ); + if (len2 <= 0 || len2 >= sizeof(buf) - len) + return -500; + len += len2; + } + len2=sprintf(buf2, "RTSP/1.0 200 OK\r\nCSeq: %d\r\n" + "Content-Type: application/sdp\r\n" + "Content-Base: rtsp://%s/\r\n" + "Content-Length: %d\r\n" + "\r\n", + con->seq, con->sadr_ip, len); + + sendlen(con->sock, buf2, len2); + sendlen(con->sock, buf, len); + dbgprintf(DEBUG_RTSP, "Send:\n%s", buf2); + dbgprintf(DEBUG_RTSP, "%s\n", buf); + return 0; +} + +static void send_describe2(struct oscon *con, char *url) +{ + uint8_t buf[1024], buf2[1024], *p; + int len, len2; + + //while (*url && *url != '?') + //url++; + p = url; + while (*p && *p != ' ') + p++; + *p = 0; + + len = snprintf(buf, sizeof(buf), + "v=0\r\n" + "o=- 9876543210 1 IN IP4 %s\r\n" + "s=MPEG TS\r\n" + "t=0 0\r\n" + "m=video 0 RTP/AVP 33\r\n" + "c=IN IP4 0.0.0.0\r\n" + "a=control:%s\r\n", + con->sadr_ip, + url + ); + if (len <= 0 || len >= sizeof(buf)) + return; + len2=sprintf(buf2, "RTSP/1.0 200 OK\r\nCSeq: %d\r\nContent-Type: application/sdp\r\n" + "Content-Length: %d\r\n\r\n", con->seq, len); + + sendlen(con->sock, buf2, len2); + sendlen(con->sock, buf, len); + dbgprintf(DEBUG_RTSP, "Send:\n%s", buf2); + dbgprintf(DEBUG_RTSP, "%s\n", buf); +} + +#define MAX_PID 32 + +static int getsparam(char *b, char *name, char *q[], struct dvb_params *p, int type) +{ + int s, l = strlen(name), m; + + if (strncasecmp(b, name, l)) + return 0; + b += l; + if (b[0] == '&' || b[0] == ' ' || !b[m]) + return l; + for (s = 1; q[s]; s++) { + m = strlen(q[s]); + if (!strncasecmp(b, q[s], m) && + (b[m] == '&' || b[m] == ' ' || !b[m])) { + p->param[type] = s; + p->set |= (1UL << type); + dbgprintf(DEBUG_SYS, "%s%d(%s), ", name, p->param[type], q[s]); + return l + m; + } + } + return -1; +} + +static int parse_url(struct oscon *con, int streamonly) +{ + struct dvb_params *p = &con->p; + char *url, *end; + struct ossess *oss; + uint32_t pid; + int s, l; + + dbgprintf(DEBUG_SYS, "parsing URL : %s\n", con->url); + memset(p, 0, sizeof(struct dvb_params)); + + for (url = con->url; *url == ' '; url++); + if (strncasecmp(url, "rtsp://", 7)) + return -1; + for (url += 7; *url != '/'; url++) + if (*url == '\0') + return 0; + url++; + if (*url == '\0' || *url == ' ') + return 0; + if (*url != '?') { + if (strncasecmp(url, "stream=", 7)) + return -1; + url += 7; + errno = 0; + p->param[PARAM_STREAMID] = strtoul(url, &end, 10); + if (errno) + return -1; + p->set |= (1UL << PARAM_STREAMID); + dbgprintf(DEBUG_SYS, "streamid = %d, ", p->param[PARAM_STREAMID]); + url = end; + } + if (*url != '\0' && *url != ' ' && *url != '?') + return -1; + if (!streamonly && *url == '?') { + do { + url++; + if (!strncasecmp(url, "src=", 4)) { + url += 4; + errno = 0; + p->param[PARAM_SRC] = strtoul(url, &end, 10); + if (url == end) + return -1; + p->set |= (1UL << PARAM_SRC); + dbgprintf(DEBUG_SYS, "src=%d, ", p->param[PARAM_SRC]); + } else if (!strncasecmp(url, "fe=", 3)) { + url += 3; + p->param[PARAM_FE] = strtoul(url, &end, 10); + if (end == url) + break; + p->set |= (1UL << PARAM_FE); + dbgprintf(DEBUG_SYS, "fe=%d, ", p->param[PARAM_FE]); + } else if (!strncasecmp(url, "c2tft=", 6)) { + url += 6; + p->param[PARAM_C2TFT] = strtoul(url, &end, 10); + if (end == url) + break; + p->set |= (1UL << PARAM_C2TFT); + dbgprintf(DEBUG_SYS, "c2tft=%d, ", p->param[PARAM_C2TFT]); + } else if (!strncasecmp(url, "ds=", 3)) { + url += 3; + p->param[PARAM_DS] = strtoul(url, &end, 10); + if (end == url) + break; + p->set |= (1UL << PARAM_DS); + dbgprintf(DEBUG_SYS, "ds=%d, ", p->param[PARAM_C2TFT]); + } else if (!strncasecmp(url, "plp=", 4)) { + url += 4; + p->param[PARAM_PLP] = strtoul(url, &end, 10); + if (end == url) + break; + p->set |= (1UL << PARAM_PLP); + dbgprintf(DEBUG_SYS, "plp=%d, ", p->param[PARAM_PLP]); + } else if (!strncasecmp(url, "specinv=", 8)) { + url += 8; + p->param[PARAM_SPECINV] = strtoul(url, &end, 10); + if (end == url) + break; + p->set |= (1UL << PARAM_SPECINV); + dbgprintf(DEBUG_SYS, "plp=%d, ", p->param[PARAM_PLP]); + } else if (!strncasecmp(url, "sm=", 3)) { + url += 3; + p->param[PARAM_SM] = strtoul(url, &end, 10); + if (end == url) + break; + p->set |= (1UL << PARAM_SM); + dbgprintf(DEBUG_SYS, "sm=%d, ", p->param[PARAM_SM]); + } else if (!strncasecmp(url, "t2id=", 5)) { + url += 5; + p->param[PARAM_T2ID] = strtoul(url, &end, 10); + if (end == url) + break; + p->set |= (1UL << PARAM_T2ID); + dbgprintf(DEBUG_SYS, "t2id=%d, ", p->param[PARAM_T2ID]); + } else if (!strncasecmp(url, "freq=", 5)) { + float f; + + url += 5; + f = strtof(url, &end); + p->param[PARAM_FREQ] = f * 1000.0; + if (url == end) + return -1; + p->set |= (1UL << PARAM_FREQ); + dbgprintf(DEBUG_SYS, "freq=%u.%03u, ", + p->param[PARAM_FREQ] / 1000, + p->param[PARAM_FREQ] % 1000); + } else if ((l = getsparam(url, "pol=", pol2str, p, PARAM_POL))) { + if (l < 0) + return l; + end = url + l; + } else if ((l = getsparam(url, "msys=", msys2str, p, PARAM_MSYS))) { + if (l < 0) + return l; + end = url + l; + } else if ((l = getsparam(url, "ro=", roll2str, p, PARAM_RO))) { + if (l < 0) + return l; + end = url + l; + } else if ((l = getsparam(url, "mtype=", mtype2str, p, PARAM_MTYPE))) { + if (l < 0) + return l; + end = url + l; + } else if ((l = getsparam(url, "gi=", gi2str, p, PARAM_GI))) { + if (l < 0) + return l; + end = url + l; + } else if ((l = getsparam(url, "tmode=", tmode2str, p, PARAM_TMODE))) { + if (l < 0) + return l; + end = url + l; + } else if ((l = getsparam(url, "plts=", pilot2str, p, PARAM_PLTS))) { + if (l < 0) + return l; + end = url + l; + } else if (!strncasecmp(url, "sr=", 3)) { + url += 3; + p->param[PARAM_SR] = strtoul(url, &end, 10); + p->set |= (1UL << PARAM_SR); + dbgprintf(DEBUG_SYS, "sr=%d, ", p->param[PARAM_SR]); +#if 0 + } else if ((l = getsparam(url, "bw=", bw2str, p, PARAM_BW))) { + if (l < 0) + return l; + end = url + l; +#else + } else if (!strncasecmp(url, "bw=", 3)) { + float f; + + url += 3; + f = strtof(url, &end); + p->param[PARAM_BW_HZ] = f * 1000000.0; + if (f == 5.0) + p->param[PARAM_BW] = BANDWIDTH_5_MHZ; + else if (f == 6.0) + p->param[PARAM_BW] = BANDWIDTH_6_MHZ; + else if (f == 7.0) + p->param[PARAM_BW] = BANDWIDTH_7_MHZ; + else if (f == 8.0) + p->param[PARAM_BW] = BANDWIDTH_8_MHZ; + else if (f == 10.0) + p->param[PARAM_BW] = BANDWIDTH_10_MHZ; + else if (f == 1.712) + p->param[PARAM_BW] = BANDWIDTH_1_712_MHZ; + else + return -1; + p->param[PARAM_BW]++; + if (url == end) + return -1; + p->set |= (1UL << PARAM_BW); + p->set |= (1UL << PARAM_BW_HZ); +#endif + } else if ((l = getsparam(url, "fec=", fec2str, p, PARAM_FEC))) { + if (l < 0) + return l; + end = url + l; + } else if (!strncasecmp(url, "pids=", 5)) { + if (p->set & ((1UL << PARAM_APID) | (1UL << PARAM_DPID))) + return -1; + url += 5; + memset(p->pid, 0, 0x400); + do { + pid = strtoul(url, &end, 10); + if (url == end) { + if (!strncasecmp(url, "all", 3)) { + memset(p->pid, 0xff, 0x400); + end = url + 3; + } else if (!strncasecmp(url, "none", 4)) { + memset(p->pid, 0x00, 0x400); + end = url + 4; + } else + return -1; + } else { + if (pid > 8191) + return -1; + p->pid[pid >> 3] |= (1 << (pid & 7)); + } + url = end; + } while (*(url++) == ','); + p->set |= (1UL << PARAM_PID); + } else if (!strncasecmp(url, "addpids=", 8)) { + if (p->set & (1UL << PARAM_PID)) + return -1; + url += 8; + do { + pid = strtoul(url, &end, 10); + if (url == end) + return -1; + url = end; + p->pid[pid >> 3] |= (1 << (pid & 7)); + dbgprintf(DEBUG_SYS, "add PID=%d, ", pid); + } while (*(url++) == ','); + p->set |= (1UL << PARAM_APID); + } else if (!strncasecmp(url, "delpids=", 8)) { + if (p->set & (1UL << PARAM_PID)) + return -1; + url += 8; + do { + pid = strtoul(url, &end, 10); + if (url == end) + return -1; + url = end; + p->dpid[pid >> 3] |= (1 << (pid & 7)); + dbgprintf(DEBUG_SYS, "del PID=%d, ", pid); + } while (*(url++) == ','); + p->set |= (1UL << PARAM_DPID); + } else if (!strncasecmp(url, "x_pmt=", 6)) { + uint32_t pmt, sid, num = 0; + + url += 6; + do { + pmt = strtoul(url, &end, 10); + if (url == end || pmt >= 8192) + return -1; + if (*end == '.') { + url = end + 1; + sid = strtoul(url, &end, 10); + if (url == end) + return -1; + pmt |= (sid << 16); + } + if (num < MAX_PMT) + p->pmt[num++] = pmt; + dbgprintf(DEBUG_SYS, "+PMT=%08x, ", pmt); + url = end; + } while (*(url++) == ','); + p->set |= (1UL << PARAM_PMT); + } else if (!strncasecmp(url, "x_ci=", 5)) { + url += 5; + p->param[PARAM_CI] = strtoul(url, &end, 10); + if (url == end) + return -1; + p->set |= (1UL << PARAM_CI); + dbgprintf(DEBUG_SYS, "ci=%d, ", p->param[PARAM_CI]); + } else { + dbgprintf(DEBUG_SYS, "unknown parameter %s\n", url); + while (*url != '&' && *url && *url != ' ') + url++; + end = url; + /* ignore unknown parameters: return -1; */ + } + url = end; + } while (*url == '&'); + } + while (*url == '/') + url++; + if (*url != ' ') + return -1; + while (*url == ' ') + url++; + if (strncasecmp(url, "RTSP/1.0", 8)) + return -1; + dbgprintf(DEBUG_SYS, "\n"); + return 0; +} + +static int set_rtcp_msg(struct ossess *sess) +{ + char rtcp[512 - 96 - 102]; + int len; + struct dvb_ns_rtcp rtcpm = { .msg = rtcp}; + + if (!sess->state) + return -1; + len = session_string(sess, rtcp, sizeof(rtcp)); + if (len <= 0) + return -1; + rtcpm.len = len; + dbgprintf(DEBUG_RTSP, "%s\n", rtcp); + if (sess->nsfd < 0) + return -1; + return ioctl(sess->nsfd, NS_SET_RTCP_MSG, &rtcpm); +} + +static int set_rtcp_msgs(struct osstrm *str) +{ + char rtcp[512 - 96 - 102]; + int len; + struct dvb_ns_rtcp rtcpm = { .msg = rtcp}; + int i; + struct ossess *sess; + + if (!str->state) + return -1; + for (i = 0; i < MAX_SESSION; i++) { + sess = &str->os->session[i]; + if (!sess->state) + continue; + len = session_string(sess, rtcp, sizeof(rtcp)); + if (len <= 0) + continue; + rtcpm.len = len; + dbgprintf(DEBUG_RTSP, "%s\n", rtcp); + + if (sess->stream && (sess->stream == str) && (sess->nsfd > 0)) + ioctl(sess->nsfd, NS_SET_RTCP_MSG, &rtcpm); + } + return 0; +} + +static int set_ns(struct ossess *sess, struct dvb_ns_params *nsp) +{ + struct osstrm *str = sess->stream; + int fd = sess->nsfd; + uint8_t *pids = sess->p.pid; + + if (fd < 0) + return 0; + dbgprintf(DEBUG_SYS, "%s\n", __FUNCTION__); + ioctl(fd, NS_SET_NET, nsp); + set_rtcp_msg(sess); + ioctl(fd, NS_SET_PIDS, &pids); + return 0; +} + +static int get_ns(struct ossess *sess) +{ + struct dvbfe *fe = sess->stream->fe; + char fname[80]; + + sprintf(fname, "/dev/dvb/adapter%d/ns%d", fe->anum, fe->fnum); + sess->nsfd = open(fname, O_RDWR); + if (sess->nsfd < 0 && errno != 2) { + dbgprintf(DEBUG_SYS, "no ns free\n"); + return -1; + } + dbgprintf(DEBUG_SYS, "got fd %d, for %s\n", sess->nsfd, fname); + return 0; +} + +static int setup_nsp(struct ostrans *trans, struct dvb_ns_params *nsp) +{ + void *adr; + + memset(nsp, 0, sizeof(struct dvb_ns_params)); + memcpy(nsp->dmac, trans->cmac, 6); + memcpy(nsp->smac, trans->smac, 6); + nsp->smac[5] |= 1; + nsp->sport = trans->sport; + nsp->sport2 = trans->sport2; + nsp->dport = trans->cport; + nsp->dport2 = trans->cport2; + if (trans->rtp) { + nsp->flags = DVB_NS_RTP | DVB_NS_RTCP; + if (!(trans->flags & TRANS_NO_RTP_TO)) + nsp->flags |= DVB_NS_RTP_TO; + } + nsp->qos = 5; + nsp->vlan = 0; + nsp->ttl = 64; + dbgprintf(DEBUG_SYS, "ports: %d-%d %d-%d\n", + nsp->sport, nsp->sport2, nsp->dport, nsp->dport2); + + memcpy(nsp->sip, trans->sip, 16); + memcpy(nsp->dip, trans->cip, 16); + + if (trans->mcast) { + uint8_t *mac = adr; + + memcpy(nsp->dmac, trans->mcmac, 6); + memcpy(nsp->dip, trans->mcip, 16); + + nsp->ttl = trans->ttl ? trans->ttl : 2; + + //dump(nsp->dmac, 6); + //dump(nsp->dip, 16); + dbgprintf(DEBUG_SYS, "MC STREAM\n"); + } + memcpy(nsp->ssrc, trans->ssrc, 4); + return 0; +} + +static int merge_pids(struct dvb_params *op, struct dvb_params *p) +{ + int i; + + if (p->set & (1UL << PARAM_PID)) + for (i = 0 ; i < 1024 ; i++) + op->pid[i] = p->pid[i]; + if (p->set & (1UL << PARAM_APID)) + for (i = 0 ; i < 1024 ; i++) + op->pid[i] |= p->pid[i]; + if (p->set & (1UL << PARAM_DPID)) + for (i = 0 ; i < 1024 ; i++) + op->pid[i] &= ~p->dpid[i]; +} + +static int merge_params(struct dvb_params *op, struct dvb_params *p) +{ + int i; + + if (p->set & 0xfff8) { + for (i = PARAM_FE ; i < PARAM_PID ; i++) + if (p->set & (1UL << i)) { + op->param[i] = p->param[i]; + dbgprintf(DEBUG_SYS, "para %d = %d\n", i, p->param[i]); + op->set |= (1UL << i); + } + } +} + +static int setup_session(struct oscon *con, int newtrans) +{ + struct dvbfe *fe; + struct dvb_ns_params nsp; + struct ossess *sess = con->session; + struct dvb_params *p = &con->p; + struct dvb_params *sp = &sess->p; + struct ostrans *trans = &con->trans; + struct osstrm *str = sess->stream; + + if (!str) + return -500; + merge_pids(sp, p); + if (str->session == sess) { /* stream owner */ + merge_params(sp, p); + + if (str->fe && (sp->set & (1UL << PARAM_FE)) && + (sp->param[PARAM_FE] != str->fe->nr)) { + release_fe(con->os, str->fe); + if (sess->nsfd >= 0) + close(sess->nsfd); + } + if (!str->fe) { + if (!(sp->set & (1UL << PARAM_MSYS))) + return 0; + if (sp->set & (1UL << PARAM_FE)) + fe = alloc_fe_num(sess->os, + sp->param[PARAM_FE] - 1, + sp->param[PARAM_MSYS] - 1); + else + fe = alloc_fe(sess->os, + sp->param[PARAM_MSYS] - 1); + if (!fe) { + dbgprintf(DEBUG_SYS, "no fe\n"); + return -404; + } + str->fe = fe; + dvb_tune(str->fe, sp); + } else if (p->set & 0xffff8) { + dvb_tune(str->fe, sp); + } + } + if (sess->nsfd < 0) { +#ifndef IGNORE_NS + if (get_ns(sess) < 0) + return -455; +#endif + newtrans = 1; + } + if (newtrans) { + if (setup_nsp(&sess->trans, &nsp) < 0) + return -1; + if (set_ns(sess, &nsp) < 0) + return -1; + } else if (p->set & ((1UL << PARAM_PID) | (1UL << PARAM_APID) | (1UL << PARAM_DPID))) { + uint8_t *pids = (sp->pid); + + if (sess->nsfd >= 0) + ioctl(sess->nsfd, NS_SET_PIDS, &pids); + } + if (p->set & ((1UL << PARAM_CI))) { + if (p->param[PARAM_CI] == 0 && str->ca) + release_ca(str->ca); + if (!str->ca) { + if (sess->playing) + return -455; + str->ca = alloc_ca_num(str, p->param[PARAM_CI] - 1); + } + if (!str->ca) + return -455; + } + if (p->set & ((1UL << PARAM_PMT))) { + if (!str->ca) { + if (sess->playing) + return -455; + str->ca = alloc_ca(str); + } + if (!str->ca) + return -455; + if (str->ca) + set_pmt(str->ca, p->pmt); + } + if (con->session->trans.mcast) { + if (con->os->has_switch) + update_switch_vec(sess); + } + return 0; +} + +static int stop_session(struct ossess *sess) +{ + if (!sess->playing) + return 0; + sess->playing &= ~1; + if (sess->playing) + return 0; + printf("stopping session %d\n", sess->nr); + if (sess->nsfd >= 0) + ioctl(sess->nsfd, NS_STOP); + return 0; +} + +static int start_session(struct ossess *sess) +{ + if (sess->playing) + return 0; + dbgprintf(DEBUG_SYS, "START\n"); + printf("start session %d\n", sess->nr); + if (sess->stream->ca) { + uint8_t canum = sess->stream->ca->nr - 1; + if (sess->nsfd >= 0) + ioctl(sess->nsfd, NS_SET_CI, &canum); + } + if (sess->nsfd >= 0) + ioctl(sess->nsfd, NS_START); + sess->playing |= 1; + return 0; +} + +static int play_session(struct oscon *con) +{ + int res; + struct ossess *sess = con->session; + struct dvb_params *p = &con->p; + struct ostrans *trans = &con->trans; + struct octoserve *os = sess->os; + + if (p) { + res = setup_session(con, 0); + if (res < 0) + return res; + } +#ifndef IGNORE_NS + if (sess->nsfd < 0) + return -455; +#endif + dbgprintf(DEBUG_SYS, "%s fd %d\n", __FUNCTION__, sess->nsfd); + pthread_mutex_lock(&os->lock); + start_session(sess); + sess->playing |= 2; + pthread_mutex_unlock(&os->lock); + return 0; +} + +static struct ossess *match_session(struct octoserve *os, uint8_t *group) +{ + struct ossess *sess; + int i; + + for (i = 0; i < MAX_SESSION; i++) { + sess = &os->session[i]; + if (!sess->state || !sess->trans.mcast) + continue; + if (!memcmp(sess->trans.mcip, group, 4)) + return sess; + } + return NULL; +} + +void mc_check(struct ossess *sess) +{ + struct osmcc *mcc, *next; + struct octoserve *os = sess->os; + + if (sess->mcc_state && (os->igmp_mode & 1)) + return; + pthread_mutex_lock(&os->lock); + for (mcc = sess->mccs.lh_first; mcc; mcc = next) { + next = mcc->mcc.le_next; + if (((sess->mcc_state == 0) && (sess->mcc_tag != mcc->tag)) || + (((os->igmp_mode & 1) == 0) && (os->igmp_tag != mcc->gtag))) { + printf("removed client at %u.%u.%u.%u\n", + mcc->ip[0], mcc->ip[1], mcc->ip[2], mcc->ip[3]); + printf("mcc_tags: %d %d\n", sess->mcc_tag, mcc->tag); + printf("gtags: %d %d\n", os->igmp_tag, mcc->gtag); + LIST_REMOVE(mcc, mcc); + free(mcc); + } + } + if (os->has_switch) + update_switch_vec(sess); + if (!sess->mccs.lh_first) + stop_session(sess); + pthread_mutex_unlock(&os->lock); +} + +void mc_del(struct ossess *sess) +{ + struct osmcc *mcc, *next; + struct octoserve *os = sess->os; + + pthread_mutex_lock(&os->lock); + for (mcc = sess->mccs.lh_first; mcc; mcc = next) { + next = mcc->mcc.le_next; + LIST_REMOVE(mcc, mcc); + free(mcc); + } + if (os->has_switch) + update_switch_vec(sess); + pthread_mutex_unlock(&os->lock); +} + +static void killall_sessions(struct octoserve *os) +{ + struct ossess *sess; + int i; + + for (i = 0; i < MAX_SESSION; i++) { + sess = &os->session[i]; + if (!sess->state) + continue; + release_session(sess); + } +} + +void mc_join(struct octoserve *os, uint8_t *ip, uint8_t *mac, uint8_t *group) +{ + struct ossess *sess; + struct osmcc *mcc, *newmcc; + + pthread_mutex_lock(&os->lock); + if ((sess = match_session(os, group)) == NULL) + goto out; + + printf("matched session %d to join %u.%u.%u.%u\n", + sess->nr, ip[0], ip[1], ip[2], ip[3]); + for (mcc = sess->mccs.lh_first; mcc; mcc = mcc->mcc.le_next) + if (!memcmp(ip, mcc->ip, 4)) { + mcc->tag = sess->mcc_tag; + mcc->gtag = os->igmp_tag; + printf("already in list, tag = %08x, gtag = %08x\n", mcc->tag, mcc->gtag); + goto out; + } + newmcc = malloc(sizeof(struct osmcc)); + if (!newmcc) { + printf("Could not allocate new multicast client entry\n"); + goto out; + } + memset(newmcc, 0, sizeof(struct osmcc)); + LIST_INSERT_HEAD(&sess->mccs, newmcc, mcc); + memcpy(newmcc->ip, ip, 4); + newmcc->tag = sess->mcc_tag; + newmcc->gtag = os->igmp_tag; + if (mac) { + int port; + + memcpy(newmcc->mac, mac, 6); + if (os->has_switch) + port = switch_get_port(newmcc->mac); + else + port = 0; + printf("New client at port %02x\n", port); + if (port >= 0) { + newmcc->port_vec = port; + sess->mcc_port_vec |= port; + } + if (os->has_switch) + update_switch_vec(sess); + } + if (!sess->playing) + start_session(sess); +out: + pthread_mutex_unlock(&os->lock); +} + +void mc_query(struct ossess *sess) +{ + /* query in group if anybody still there */ + if (!sess->mcc_state) { + time(&sess->mcc_time); + sess->mcc_state = 1; + } +} + +void mc_leave(struct octoserve *os, uint8_t *ip, uint8_t *group) +{ + struct ossess *sess; + struct osmcc *mcc, *next; + + pthread_mutex_lock(&os->lock); + if ((sess = match_session(os, group)) == NULL) + goto out; + + printf("matched session %d to leave %u.%u.%u.%u\n", + sess->nr, ip[0], ip[1], ip[2], ip[3]); + mc_query(sess); + + for (mcc = sess->mccs.lh_first; mcc; mcc = next) { + next = mcc->mcc.le_next; + if (!memcmp(ip, mcc->ip, 4)) { + LIST_REMOVE(mcc, mcc); + free(mcc); +#if 0 + if (!sess->mccs.lh_first) + stop_session(sess); + mc_query(sess); +#endif + break; + } + } + if (os->has_switch) + update_switch_vec(sess); +out: + pthread_mutex_unlock(&os->lock); +} + +static void send_play(struct oscon *con) +{ + uint8_t buf[1024]; + int len; + + dbgprintf(DEBUG_SYS, "%s\n", __FUNCTION__); + len = sprintf(buf, + "RTSP/1.0 200 OK\r\n" + "CSeq: %d\r\n" + "Session: %010d\r\n" + "RTP-Info: url=%s\r\n" + "\r\n", con->seq, con->session->id, con->url); + sendlen(con->sock, buf, len); + dbgprintf(DEBUG_RTSP, "Send: %s\n", buf); +} + +static void send_teardown(struct oscon *con) +{ + uint8_t buf[256]; + int len; + + len=sprintf(buf, + "RTSP/1.0 200 OK\r\n" + "CSeq: %d\r\n" + "Session: %010d\r\n" + "\r\n", con->seq, con->session->id); + sendlen(con->sock, buf, len); + dbgprintf(DEBUG_RTSP, "Send: %s\n", buf); +} + +static int parse_transport(struct oscon *con, char *line) +{ + char *end, *arg; + struct ostrans *t = &con->trans; + int ttlset = 0; + + dbgprintf(DEBUG_RTSP, "parse: %s\n", line); + + for (arg = line; *arg == ' '; arg++); + + do { + printf("arg:%s\n", arg); + if (!strncasecmp(arg, "RTP/AVP/UDP", 11)) { + t->rtp = 1; + end = arg + 11; + } else if (!strncasecmp(arg, "RTP/AVP", 7)) { + t->rtp = 1; + end = arg + 7; + } else if (!strncasecmp(arg, "UDP", 3)) { + t->rtp = 0; + end = arg + 3; + } else if (!strncasecmp(arg, "unicast", 7)) { + t->mcast = 0; + end = arg + 7; + } else if (!strncasecmp(arg, "multicast", 9)) { + t->mcast = 1; + end = arg + 9; + } else if (!strncasecmp(arg, "client_port=", 12)) { + arg += 12; + t->cport = strtoul(arg, &end, 10); + if (*end == '-') + t->cport2 = strtoul(end + 1, &end, 10); + else + t->cport2 = 0; + } else if (!strncasecmp(arg, "port=", 5)) { + arg += 5; + t->cport = strtoul(arg, &end, 10); + if (*end == '-') + t->cport2 = strtoul(end + 1, &end, 10); + else + t->cport2 = 0; + } else if (!strncasecmp(arg, "interleaved=", 12)) { + return -461; + arg += 12; + strtoul(arg, &end, 10); + strtoul(end + 1, &end, 10); + } else if (!strncasecmp(arg, "ttl=", 4)) { + arg += 4; + t->ttl = strtoul(arg, &end, 10); + ttlset = 1; + } else if (!strncasecmp(arg, "destination=", 12)) { + char c; + + arg += 12; + end = arg; + while (*end && *end != ';' && *end != ' ') + end++; + c = *end; + *end = 0; + inet_pton(AF_INET, arg, &t->mcip); + t->mcmac[0] = 0x01; + t->mcmac[1] = 0x00; + t->mcmac[2] = 0x5e; + t->mcmac[3] = t->mcip[1] & 0x7f; + t->mcmac[4] = t->mcip[2]; + t->mcmac[5] = t->mcip[3]; + *end = c; + t->flags |= TRANS_ALT_DEST; + } else + return -461; + arg = end; + if (*arg != ';' && *arg != ' ' && *arg != 0) + return -461; + } while (*(arg++) == ';'); + + if (t->flags & TRANS_ALT_DEST && !t->mcast) { + ip2mac(t->mcip, t->mcmac); + + } + if (!t->ttl && !ttlset) + t->ttl = 2; + dbgprintf(DEBUG_RTSP, "parsed\n"); + return 0; +} + +static int parse_x_octonet(struct oscon *con, char *line) +{ + char *end, *arg; + + dbgprintf(DEBUG_RTSP, "parse: %s\n", line); + + for (arg = line; *arg == ' '; arg++); + + do { + if (!strncasecmp(arg, "switch=", 7)) { + uint32_t port; + + arg += 7; + do { + port = strtoul(arg, &end, 10); + if (arg == end) + return -1; + arg = end; + if (port < 7) + con->x_ports |= 1 << (port - 1); + } while (*(arg++) == ','); + printf("x_ports = %02x\n", con->x_ports); + } else + return -1; + arg = end; + } while (*(arg++) == ';'); + dbgprintf(DEBUG_RTSP, "parsed\n"); + return 0; +} + +void send_setup(struct oscon *con) +{ + uint8_t buf[256]; + int len; + struct ostrans *t = &con->session->trans; + + if (t->mcast) + len = sprintf(buf, + "RTSP/1.0 200 OK\r\n" + "CSeq: %d\r\nSession: %010d;timeout=%u\r\n" + "Transport: %s;multicast;destination=%d.%d.%d.%d;" + "port=%d-%d;ttl=%d;source=%s\r\n" + "com.ses.streamID: %d\r\n\r\n", + con->seq, con->session->id, con->session->timeout_len, + t->rtp ? "RTP/AVP" : "UDP", + t->mcip[0], t->mcip[1], t->mcip[2], t->mcip[3], + t->cport, t->cport2, t->ttl, + con->sadr_ip, con->session->stream->nr + ); + else + len = sprintf(buf, + "RTSP/1.0 200 OK\r\n" + "CSeq: %d\r\nSession: %010d;timeout=%u\r\n" + "Transport: %s;unicast;client_port=%d-%d;server_port=%d-%d\r\n" + "com.ses.streamID: %d\r\n\r\n", + con->seq, con->session->id, con->session->timeout_len, + t->rtp ? "RTP/AVP" : "UDP", + t->cport, t->cport2, + con->session->stream->sport, + con->session->stream->sport2, + con->session->stream->nr + ); + sendlen(con->sock, buf, len); + dbgprintf(DEBUG_RTSP, "Send: %s\n", buf); +} + +static void cpyarg(char *d, char *s) +{ + while (*s == ' ') + s++; + strcpy(d, s); +} + +static int proc_line(struct oscon *con) +{ + char *line = con->buf; + int res; + + if (con->ln == 0) { + if (!strncasecmp(line, "OPTIONS", 7)) { + cpyarg(con->url, line + 7); + con->cmd = M_OPTIONS; + } else if (!strncasecmp(line, "DESCRIBE", 8)) { + cpyarg(con->url, line + 8); + con->cmd = M_DESCRIBE; + } else if (!strncasecmp(line, "SETUP", 5)) { + cpyarg(con->url, line + 5); + con->cmd = M_SETUP; + } else if (!strncasecmp(line, "PLAY", 4)) { + cpyarg(con->url, line + 4); + con->cmd = M_PLAY; + } else if (!strncasecmp(line, "TEARDOWN", 8)) { + cpyarg(con->url, line + 8); + con->cmd = M_TEARDOWN; + } else { + con->cmd = M_UNKNOWN; + return -1; + } + return 0; + } + + if (line[0] == '\0') { /* last line */ + if (con->error) { + send_error(con, con->error); + } else { + switch (con->cmd) { + case M_OPTIONS: + if (con->session_parsed && !con->session) + send_error(con, 404); + else + send_option(con); + break; + case M_DESCRIBE: + { + int only = -1; + + if (parse_url(con, 0) < 0) { + send_error(con, 400); + break; + } + if (con->p.set & ~(1UL << PARAM_STREAMID)) { + send_describe2(con, con->url); + break; + } + if (con->p.set & (1UL << PARAM_STREAMID)) + only = con->p.param[PARAM_STREAMID]; + res = send_describe(con, only); + if (res < 0) + send_error(con, -res); + break; + } + case M_SETUP: + { + struct osstrm *str = 0; + int newtrans = 0; + + if (!con->transport_parsed) { + /* no proper transport params given */ + send_error(con, 400); + break; + } + if (con->session_parsed && !con->session) { + /* no session with given ID found */ + send_error(con, 454); + break; + } + if (parse_url(con, 0) < 0) { + /* invalid params in URL */ + send_error(con, 400); + break; + } + if (con->p.set & (1UL << PARAM_STREAMID)) { + dbgprintf(DEBUG_SYS, "existing stream %d\n", + con->p.param[PARAM_STREAMID]); + str = get_stream(con->os, con->p.param[PARAM_STREAMID]); + if (!str) { + /* no stream with given ID */ + send_error(con, 400); + break; + } + if (con->session && con->session != str->session) { + /* if we already have a session ID we + have to be stream owner */ + send_error(con, 400); + break; + } + } + if (!con->session) { + /* alloc new session */ + con->session = alloc_session(con->os); + if (!con->session) { + send_error(con, 400); + break; + } + if (!con->session->stream) { + if (str) { + /* use existing stream and stream params*/ + con->session->stream = str; + if (con->session->stream->session) { + memcpy(&con->session->p, + &con->session->stream->session->p, + sizeof(struct dvb_params)); + } + } else { + con->session->stream = alloc_stream(con->os); + if (!con->session->stream) { + send_error(con, 400); + break; + } + con->session->stream->session = con->session; + } + } + newtrans = 1; + } + if (newtrans || + con->session->trans.mcast != con->trans.mcast || + con->session->trans.cport != con->trans.cport || + con->session->trans.cport2 != con->trans.cport2 || + con->session->trans.flags != con->trans.flags || + con->session->trans.ttl != con->trans.ttl) { + con->trans.sport = con->session->stream->sport; + con->trans.sport2 = con->session->stream->sport2; + + /* set transport struct according to session + and transport parameters */ + if (con->trans.mcast && con->trans.cport == 0) { + con->trans.cport = con->trans.sport; + con->trans.cport2 = con->trans.sport2; + } + + if (con->trans.mcast && + !(con->trans.flags & TRANS_ALT_DEST)) { + uint8_t mac[6] = { 0x01, 0x00, 0x5e, + con->os->ssdp.devid & 0x7f, 1, + con->session->stream->nr }; + uint8_t ip[4] = { 239, con->os->ssdp.devid, 1, + con->session->stream->nr }; + + memcpy(con->trans.mcmac, mac, 6); + memcpy(con->trans.mcip, ip, 4); + } + con->session->trans = con->trans; + newtrans = 1; + } + res = setup_session(con, newtrans); + if (res < 0) { + release_session(con->session); + send_error(con, -res); + } else + send_setup(con); + break; + } + case M_PLAY: + if (!con->session || !con->session->stream) { + send_error(con, 400); + break; + } + if (parse_url(con, 0) < 0) { + send_error(con, 400); + break; + } + if (con->x_octonet_parsed) { + con->session->port_vec = con->x_ports; + printf("port_vec = %02x\n", con->session->port_vec); + } + res = play_session(con); + if (res < 0) + send_error(con, -res); + else + send_play(con); + break; + case M_TEARDOWN: + if (parse_url(con, 0) < 0) { + send_error(con, 400); + break; + } + if (!con->session) { + send_error(con, 404); + break; + } + send_teardown(con); + release_session(con->session); + con->session = 0; + break; + default: + send_error(con, 501); + break; + } + } + con->cmd = M_NONE; + con->transport_parsed = 0; + con->session_parsed = 0; + con->error = 0; + con->ln = -1; + return 0; + } + + if (!strncasecmp(line, "CSeq:", 5)) { + con->seq = strtoul(line + 5, NULL, 10); + //printf("CSeq = %d\n", con->seq); + } else if (!strncasecmp(line, "Transport:", 10)) { + res = parse_transport(con, line + 10); + if (res < 0) { + con->error = -res; + } else + con->transport_parsed = 1; + } else if (!strncasecmp(line, "Session:", 8)) { + uint32_t sid = strtoul(line + 8, NULL, 10); + + con->session = get_session(con->os, sid); + if (con->session) + session_timeout(con->session); + con->session_parsed = 1; + } else if (!strncasecmp(line, "User-Agent:", 11)) { + char *p = line + 11; + + while (*p == ' ') + p++; + if (!strncasecmp(p, "libvlc", 6)) + con->trans.flags |= TRANS_NO_RTP_TO; + } else if (!strncasecmp(line, "x_octonet:", 10)) { + char *p = line + 10; + + while (*p == ' ') + p++; + parse_x_octonet(con, p); + con->x_octonet_parsed = 1; + } else + ;//con->error = 551; + return 0; +} + +static const char *intop(int af, struct sockaddr *sa, char *dst, socklen_t size, uint8_t *ip) +{ + void *adr; + + if (af == AF_INET) + adr = &((struct sockaddr_in *) sa)->sin_addr; + else if (af == AF_INET6) + adr = &((struct sockaddr_in6 *) sa)->sin6_addr; + else + return NULL; + + memcpy(ip, adr, af == AF_INET ? 4 : 16); + return inet_ntop(af, adr, dst, size); +} + +static void get_ips(struct oscon *con) +{ + con->slen = sizeof(con->sadr); + con->clen = sizeof(con->cadr); + getsockname(con->sock, (struct sockaddr *) &con->sadr, &con->slen); + intop(con->trans.family, &con->sadr, con->sadr_ip, INET6_ADDRSTRLEN, con->trans.sip); + getpeername(con->sock, (struct sockaddr *) &con->cadr, &con->clen); + intop(con->trans.family, &con->cadr, con->cadr_ip, INET6_ADDRSTRLEN, con->trans.cip); +} + +static int same_ip(struct sockaddr *sa, struct sockaddr *sa2) +{ + unsigned short af = sa->sa_family; + + if (af != sa2->sa_family) + return -1; + if (af == AF_INET) + return memcmp(&((struct sockaddr_in *) sa)->sin_addr, + &((struct sockaddr_in *) sa2)->sin_addr, 4); + else if (af == AF_INET6) + return memcmp(&((struct sockaddr_in6 *) sa)->sin6_addr, + &((struct sockaddr_in6 *) sa2)->sin6_addr, 16); + else + return -1; +} + +static void init_con(struct oscon *con) +{ + int one = 1, idle = 20, intvl = 20, cnt = 3; + + get_ips(con); + if (!same_ip(&con->sadr, &con->cadr)) + memcpy(con->trans.cmac, con->os->mac, 6); + else + get_mac(con->os->ifname, &con->cadr, con->trans.cmac); + memcpy(con->trans.smac, con->os->mac, 6); + con->bufp = 0; + con->ln = 0; + con->session = 0; + setsockopt(con->sock, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof(one)); +#if 1 + setsockopt(con->sock, SOL_TCP, TCP_KEEPIDLE, &idle, sizeof(idle)); + setsockopt(con->sock, SOL_TCP, TCP_KEEPINTVL, &intvl, sizeof(intvl)); + setsockopt(con->sock, SOL_TCP, TCP_KEEPCNT, &cnt, sizeof(cnt)); +#else + setsockopt(con->sock, IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle)); + setsockopt(con->sock, IPPROTO_TCP, TCP_KEEPINTVL, &intvl, sizeof(intvl)); + setsockopt(con->sock, IPPROTO_TCP, TCP_KEEPCNT, &cnt, sizeof(cnt)); + +#endif +} + +int con_loop(struct oscon *con) +{ + uint8_t buf[1024]; + int len, i, res; + + len = recv(con->sock, buf, 1024, 0); + if (len == 0) + goto release; + if (len < 0) { + if (errno != EAGAIN) + goto release; + return 0; + } + dump(buf, len); + //printf("received %d bytes\n", len); + for (i = 0; i < len; i++) { + // FIXME send URI too long + if (con->bufp >= 8192) { + release_con(con); + return -1; + } + con->buf[con->bufp++] = buf[i]; + if (buf[i] == '\n') { + if (con->bufp < 2 || + con->buf[con->bufp - 2] != '\r') { + release_con(con); + return -1; + } + con->buf[con->bufp - 2] = 0; + if (con->buf[0]) + dbgprintf(DEBUG_SYS, "%d:%d:%d: %s\n", + con->nr, con->ln, + con->bufp, con->buf); + res = proc_line(con); + con->ln++; + con->bufp = 0; + } + } + return 0; +release: + release_con(con); + return -1; +} + +void handle_con(struct oscon *con) +{ + while (con_loop(con) >= 0); +} + +int set_nonblock(int fd) +{ + int fl = fcntl(fd, F_GETFL); + + if (fl < 0) + return fl; + return fcntl(fd, F_SETFL, fl | O_NONBLOCK); +} + +int set_block(int fd) +{ + int fl = fcntl(fd, F_GETFL); + + if (fl < 0) + return fl; + return fcntl(fd, F_SETFL, fl & ~O_NONBLOCK); +} + +void check_frontends(struct octoserve *os) +{ + int i; + struct dvbfe *fe; + uint16_t sig, snr; + fe_status_t stat; + + for (i = 0; i < os->dvbfe_num; i++) { + fe = &os->dvbfe[i]; + if (fe->state != 1) + continue; + if (ioctl(fe->fd, FE_READ_STATUS, &stat) < 0) + continue; + if (ioctl(fe->fd, FE_READ_SIGNAL_STRENGTH, &sig) < 0) + continue; + if (ioctl(fe->fd, FE_READ_SNR, &snr) < 0) + continue; + fe->stat = stat; + fe->lock = (stat == 0x1f) ? 1 : 0; + fe->level = sig >> 8; + fe->quality = snr >> 12; + dbgprintf(DEBUG_DVB, "fe%d: stat=%02x str=%04x snr=%04x\n", fe->nr, stat, sig, snr); + } +} + +static int check_streams(struct octoserve *os) +{ + int i; + struct osstrm *str; + + for (i = 0; i < MAX_STREAM; i++) { + str = &os->stream[i]; + if (!str->state) + continue; + set_rtcp_msgs(str); + } + return 0; +} + + +static int alloc_igmp_socket(struct octoserve *os) +{ + struct ip_mreq imr; + struct sockaddr_in sadr; + uint8_t one = 1; + + os->igmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_IGMP); + + set_nonblock(os->igmp_sock); + get_ifa(os->ifname, AF_INET, (struct sockaddr *) &sadr); + imr.imr_interface.s_addr = sadr.sin_addr.s_addr; + imr.imr_multiaddr.s_addr = inet_addr("224.0.0.22"); + setsockopt(os->igmp_sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, + &imr, sizeof(imr)); + setsockopt(os->igmp_sock, IPPROTO_IP, IP_MULTICAST_TTL, + &one, sizeof(one)); + setsockopt(os->igmp_sock, IPPROTO_IP, IP_ROUTER_ALERT, + &one, sizeof(one)); + time(&os->igmp_time); + /* first query after 125-94=31 seconds */ + os->igmp_mode = 0; + os->igmp_time -= 94; + os->igmp_robust = 1; + return 0; +} + +static int alloc_igmp_raw_socket(struct octoserve *os) +{ + struct ifreq ifr; + int s, n, i; + struct sockaddr cadr; + socklen_t len = sizeof(cadr); + uint8_t buf[4096]; + struct sock_filter bpf_igmp[] = { + { 0x28, 0, 0, 0x0000000c }, + { 0x15, 0, 3, 0x00000800 }, + { 0x30, 0, 0, 0x00000017 }, + { 0x15, 0, 1, 0x00000002 }, + { 0x6, 0, 0, 0x0000ffff }, + { 0x6, 0, 0, 0x00000000 }, + }; + struct sock_fprog sfprog; + + sfprog.len = ARRAY_SIZE(bpf_igmp); + sfprog.filter = bpf_igmp; + + s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)); + set_nonblock(s); + + memset (&ifr, 0, sizeof(struct ifreq)); + strncpy(ifr.ifr_name, os->ifname, IFNAMSIZ); + ioctl(s, SIOCGIFFLAGS, &ifr); + ifr.ifr_flags |= IFF_PROMISC; + ioctl(s, SIOCSIFFLAGS, &ifr); + + n = setsockopt(s, SOL_SOCKET, SO_ATTACH_FILTER, &sfprog, sizeof(sfprog)); + if (n < 0) { + printf("could not set filter\n"); + } + +#if 0 + printf("raw = %d\n", s); + for (i = 0; i < 5; i++) { + n = recvfrom(s, buf, sizeof(buf), 0, NULL, NULL); + printf("raw = %d, n = %d, errno = %d\n", s, n, errno); + dump(buf, n); + } + close (s); +#endif + os->igmp_rsock = s; + return 0; +} + +static void os_serve(struct octoserve *os) +{ + struct sigaction sa; + fd_set fds; + int mfd, i; + struct timeval timeout; + time_t t, u; + + signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, SIG_IGN); + sa.sa_handler = sigchld_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART; + + if (sigaction(SIGCHLD, &sa, NULL) == -1) + die("Error in sigaction"); + + os->rtsp_sock = streamsock("554", AF_INET, &os->rtsp_sadr); + sockname(&os->rtsp_sadr, os->rtsp_ip); + dbgprintf(DEBUG_SYS, "rtsp_ip: %s, %d\n", os->rtsp_ip, os->rtsp_sock); + if (listen(os->rtsp_sock, 20) < 0) { + dbgprintf(DEBUG_SYS, "listen error"); + return; + } + set_nonblock(os->rtsp_sock); + + alloc_igmp_raw_socket(os); + alloc_igmp_socket(os); + +#if 0 + { + struct ipv6_mreq imr; + + memset(&imr, 0, sizeof(imr)); + imr.ipv6mr_interface = if_nametoindex(os->ifname); + inet_pton(AF_INET6, "FF02::16", &imr.ipv6mr_multiaddr); + setsockopt(os->mld_sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, + &imr, sizeof(imr)); + } +#endif + time(&t); + while (!os->exit) { + int csock, ncon; + struct sockaddr cadr; + socklen_t clen = sizeof(cadr); + uint8_t buf[2048]; + int num, n; + + time(&u); + if (u > t) { + t = u; + check_session_timeouts(os); + //check_frontends(os); + check_streams(os); + check_igmp(os); + } + + timeout.tv_sec = 0; + timeout.tv_usec = 500000; + + FD_ZERO(&fds); + mfd = 0; + add_fd(os->rtsp_sock, &mfd, &fds); + //add_fd(os->igmp_sock, &mfd, &fds); + add_fd(os->igmp_rsock, &mfd, &fds); + //add_fd(os->mld_sock, &mfd, &fds); + for (i = 0, ncon = 0; i < MAX_CONNECT; i++) { + if (os->con[i].state) { + ncon++; + add_fd(os->con[i].sock, &mfd, &fds); + } + } + //printf("serve_loop: %d cons, mfd=%d\n", ncon, mfd); + num = select(mfd + 1, &fds, NULL, NULL, &timeout); + if (num < 0) + break; + if (FD_ISSET(os->igmp_sock, &fds)) { + n = recvfrom(os->igmp_sock, buf, sizeof(buf), 0, &cadr, &clen); + if (n > 0) + proc_igmp(os, buf, n, NULL); + } + if (FD_ISSET(os->igmp_rsock, &fds)) { + n = recvfrom(os->igmp_rsock, buf, sizeof(buf), 0, &cadr, &clen); + if (n > 14) + proc_igmp(os, buf + 14, n - 14, buf); + } + if (FD_ISSET(os->mld_sock, &fds)) { + n = recvfrom(os->mld_sock, buf, sizeof(buf), 0, &cadr, &clen); + printf("n = %d\n", n); + if (n > 0) + ;//dump(buf, n); + } +#ifndef MULTI_THREADED + for (i = 0; i < MAX_CONNECT; i++) + if (os->con[i].state && + FD_ISSET(os->con[i].sock, &fds)) + con_loop(&os->con[i]); +#endif + + if (FD_ISSET(os->rtsp_sock, &fds)) { + struct oscon *con; + + csock = accept(os->rtsp_sock, &cadr, &clen); + if (csock < 0) { + dbgprintf(DEBUG_SYS, "Could not accept\n"); + continue; + } + con = alloc_con(os); + if (!con) { + dbgprintf(DEBUG_SYS, "Could not alloc new connection\n"); + continue; + } + con->sock = csock; + con->trans.family = AF_INET; + init_con(con); + dbgprintf(DEBUG_SYS, "sock %d con %d on %s\n", + con->sock, con->nr, con->cadr_ip); +#ifdef MULTI_THREADED + pthread_create(&con->pt, NULL, (void *) handle_con, con); + set_block(csock); +#else + set_nonblock(csock); +#endif + } + } + killall_sessions(os); +} + +static struct octoserve *os_init(char *ifname, int nossdp, int nodms, int nodvbt, int noswitch) +{ + struct octoserve *os; + struct os_ssdp *ss; + struct ifreq ifr; + int s; + pthread_mutexattr_t mta; + + os = malloc(sizeof(*os)); + if (!os) + return NULL; + dbgprintf(DEBUG_SYS, "allocated octoserve struct, %d bytes\n", sizeof(*os)); + memset(os, 0, sizeof(struct octoserve)); + + pthread_mutexattr_init(&mta); + pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&os->lock, &mta); + + os->ifname = ifname; + os->sessionid = random(); + + if (get_ifa(ifname, AF_INET, &os->ssdp.sadr) < 0) { + perror("no such interface:"); + free(os); + return NULL; + } + get_ifa(ifname, AF_INET6, &os->ssdp.sadr6); + sockname(&os->ssdp.sadr, os->ssdp.ip); + sockname(&os->ssdp.sadr6, os->ssdp.ip6); + + strcpy(ifr.ifr_name, os->ifname); + s = socket(AF_INET, SOCK_DGRAM, 0); + ioctl(s, SIOCGIFHWADDR, &ifr); + close(s); + memcpy(os->mac, ifr.ifr_hwaddr.sa_data, 6); + dbgprintf(DEBUG_NET, "MAC %s=%02x:%02x:%02x:%02x:%02x:%02x\n", + os->ifname, + os->mac[0], os->mac[1], os->mac[2], + os->mac[3], os->mac[4], os->mac[5]); + if (os->has_switch) + switch_get_port(os->mac); + + init_dvb(os, nodvbt, noswitch); + + ss = &os->ssdp; + if (init_ssdp(os, &os->ssdp, debug, nossdp, nodms) < 0) { + release_dvb(os); + free(os); + return NULL; + } +#if 0 + if (init_http(os, debug) < 0) { + release_dvb(os); + free(os); + return NULL; + } +#endif + return os; +} + +struct octoserve *os; + +void term_action(int sig) +{ + printf("EXIT\n"); + os->exit = 1; +} + +static int set_termaction(void) +{ + struct sigaction term; + + memset(&term, 0, sizeof(term)); + term.sa_handler = term_action; + sigemptyset(&term.sa_mask); + term.sa_flags = 0; + sigaction(SIGINT, &term, NULL); + + memset(&term, 0, sizeof(term)); + term.sa_handler = term_action; + sigemptyset(&term.sa_mask); + term.sa_flags = 0; + sigaction(SIGTERM, &term, NULL); +} + +static int fexists(char *fn) +{ + struct stat b; + + return (!stat(fn, &b)); +} + +static void awrite(char *fn, char *txt) +{ + FILE *f = fopen(fn, "w"); + + if (f) + fprintf(f, "%s", txt); +} + +int main(int argc, char **argv) +{ + int nodms = 0, nossdp = 0, nodvbt = 0, vlan = 0, noswitch = 0; + + printf("Octoserve " OCTOSERVE_VERSION + ", Copyright (C) 2012-15 Digital Devices GmbH\n"); + debug = 0; + while (1) { + int option_index = 0; + int c; + static struct option long_options[] = { + {"debug", required_argument, 0, 'd'}, + {"nossdp", no_argument, 0, 'n'}, + {"nodms", no_argument, 0, 'm'}, + {"nodvbt", no_argument, 0, 't'}, + {"noswitch", no_argument, 0, 's'}, + {"help", no_argument , 0, 'h'}, + {0, 0, 0, 0} + }; + c = getopt_long(argc, argv, + "d:hnmt", + long_options, &option_index); + if (c==-1) + break; + + switch (c) { + case 'd': + debug = strtoul(optarg, NULL, 16); + break; + case 'n': + nossdp = 1; + break; + case 'm': + nodms = 1; + break; + case 't': + nodvbt = 1; + break; + case 's': + noswitch = 1; + break; + case 'h': + default: + break; + + } + } + if (optind < argc) { + printf("Warning: unused arguments\n"); + } + if (fexists("/config/nodms.enabled")) + nodms = 1; + if (fexists("/config/noswitch.enabled")) + noswitch = 1; + if (fexists("/config/nodvbt.enabled")) + nodvbt = 1; + if (fexists("/config/vlan.enabled")) { + awrite("/sys/class/ddbridge/ddbridge0/vlan", "1"); + vlan = 1; + } else + awrite("/sys/class/ddbridge/ddbridge0/vlan", "0"); + printf("nodms = %d, nodvbt = %d, vlan = %d\n", nodms, nodvbt, vlan); + + os = os_init("eth0", nossdp, nodms, nodvbt, noswitch); + if (!os) + return -1; + set_termaction(); + + os->has_switch = switch_test(); + if (os->has_switch) + printf("Switch detected\n"); + else + printf("No switch detected\n"); + + os_serve(os); + if (!nossdp) + pthread_join(os->ssdp.pt, NULL); + release_dvb(os); + free(os); +} diff --git a/octoserve/octoserve.h b/octoserve/octoserve.h new file mode 100644 index 0000000..a4e5f88 --- /dev/null +++ b/octoserve/octoserve.h @@ -0,0 +1,522 @@ +/* + (C) 2012-13 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#ifndef _OCTOSERVE_H_ +#define _OCTOSERVE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "version.h" +#include "ns.h" + +#define DEBUG_RTSP 1 +#define DEBUG_SSDP 2 +#define DEBUG_NET 4 +#define DEBUG_SYS 8 +#define DEBUG_DVB 16 +#define DEBUG_IGMP 32 +#define DEBUG_SWITCH 64 + +#define dbgprintf(_mask_, ...) \ + do { if (debug & _mask_) fprintf(stderr, __VA_ARGS__); } while (0) + + +#define SYS_DVBC2 19 + +struct ddb_reg { + __u32 reg; + __u32 val; +}; + +struct ddb_id { + __u16 vendor; + __u16 device; + __u16 subvendor; + __u16 subdevice; + __u32 hw; + __u32 regmap; +}; + +struct ddb_mdio { + __u8 adr; + __u8 reg; + __u16 val; +}; + +struct ddb_mem { + __u32 off; + __u8 *buf; + __u32 len; +}; + +#define DDB_MAGIC 'd' +#define IOCTL_DDB_FLASHIO _IOWR(DDB_MAGIC, 0x00, struct ddb_flashio) +#define IOCTL_DDB_GPIO_IN _IOWR(DDB_MAGIC, 0x01, struct ddb_gpio) +#define IOCTL_DDB_GPIO_OUT _IOWR(DDB_MAGIC, 0x02, struct ddb_gpio) +#define IOCTL_DDB_ID _IOR(DDB_MAGIC, 0x03, struct ddb_id) +#define IOCTL_DDB_READ_REG _IOWR(DDB_MAGIC, 0x04, struct ddb_reg) +#define IOCTL_DDB_WRITE_REG _IOW(DDB_MAGIC, 0x05, struct ddb_reg) +#define IOCTL_DDB_READ_MEM _IOWR(DDB_MAGIC, 0x06, struct ddb_mem) +#define IOCTL_DDB_WRITE_MEM _IOR(DDB_MAGIC, 0x07, struct ddb_mem) +#define IOCTL_DDB_READ_MDIO _IOWR(DDB_MAGIC, 0x08, struct ddb_mdio) +#define IOCTL_DDB_WRITE_MDIO _IOR(DDB_MAGIC, 0x09, struct ddb_mdio) + +struct rtsp_error { + int number; + char *name; +}; + +#define PARAM_STREAMID 0 +#define PARAM_FE 1 +#define PARAM_SRC 3 +#define PARAM_FEC 4 +#define PARAM_FREQ 5 +#define PARAM_SR 6 +#define PARAM_POL 7 +#define PARAM_RO 8 + +#define PARAM_MSYS 9 + +#define PARAM_MTYPE 10 +#define PARAM_PLTS 11 +#define PARAM_BW 12 +#define PARAM_BW_HZ 13 +#define PARAM_TMODE 14 +#define PARAM_GI 15 +#define PARAM_PLP 16 +#define PARAM_T2ID 17 +#define PARAM_SM 18 +#define PARAM_C2TFT 19 +#define PARAM_DS 20 +#define PARAM_SPECINV 21 + + +#define PARAM_CI 27 +#define PARAM_PMT 28 +#define PARAM_PID 29 +#define PARAM_APID 30 +#define PARAM_DPID 31 + +#define MAX_PMT 16 + +struct dvb_params { + uint32_t param[32]; + uint32_t set; + uint8_t pid[1024]; + uint8_t dpid[1024]; + uint32_t pmt[MAX_PMT]; +}; + +#define MAX_SOURCE 4 + +struct dvbfe { + struct octoserve *os; + struct osstrm *stream; + pthread_t pt; + + int fd; + int dmx; + uint32_t type; + int anum; + int fnum; + int state; + int nr; + int do_switch; + int has_switch; + uint32_t input[4]; + + uint32_t lof1[MAX_SOURCE]; + uint32_t lof2[MAX_SOURCE]; + uint32_t lofs[MAX_SOURCE]; + uint32_t prev_delay[MAX_SOURCE]; + + int scif_type; + int scif_slot; + uint32_t scif_freq; + + fe_status_t stat; + uint32_t level; + uint32_t lock; + uint32_t quality; + int first; + + uint32_t tune; + uint32_t param[32]; + + uint32_t n_tune; + uint32_t n_param[32]; + + pthread_mutex_t mutex; +}; + +struct dvbca { + struct octoserve *os; + struct osstrm *stream; + int fd; + uint32_t type; + int anum; + int fnum; + int state; + int nr; + int input; + + pthread_t pt; + pthread_t poll_pt; + + pthread_mutex_t mutex; + + struct en50221_transport_layer *tl; + struct en50221_session_layer *sl; + struct en50221_stdcam *stdcam; + int resource_ready; + int sentpmt; + int moveca; + int ca_pmt_version[MAX_PMT]; + int data_pmt_version; + + int setpmt; + uint32_t pmt[MAX_PMT]; + uint32_t pmt_new[MAX_PMT]; + uint32_t pmt_old[MAX_PMT]; + + int mmi_state; + uint8_t mmi_buf[16]; + int mmi_bufp; + int sock; +}; + +#define MAX_DVB_FE 16 +#define MAX_DVB_CA 4 +#define MAX_CONNECT 32 +#define MAX_SESSION 12 +#define MAX_STREAM 12 + +struct ostrans { + int cport; + int cport2; + int sport; + int sport2; + int mcast; + int family; + int ttl; + int rtp; + + uint8_t sip[16]; + uint8_t smac[6]; + uint8_t cip[16]; + uint8_t cmac[6]; + + uint8_t mcip[16]; + uint8_t mcmac[6]; + + uint8_t ssrc[4]; + uint32_t flags; +#define TRANS_NO_RTP_TO 1 +#define TRANS_ALT_DEST 2 +}; + +struct osmcc { + LIST_ENTRY(osmcc) mcc; + + uint8_t ip[4]; + int32_t port_vec; + uint8_t mac[6]; + uint32_t tag; + uint32_t gtag; +}; + +LIST_HEAD(osmcchead, osmcc); + +struct osstrm { + struct octoserve *os; + struct ossess *session; /* owner */ + struct dvbfe *fe; + struct dvbca *ca; + int nr; + int state; + + int sport; + int sport2; +}; + +struct ossess { + struct octoserve *os; + struct osstrm *stream; + uint32_t id; + int state; + int playing; + int nr; + + uint32_t timeout_len; + time_t timeout; + + int nsfd; + struct ostrans trans; + struct dvb_params p; + + struct osmcchead mccs; + uint32_t mcc_tag; + time_t mcc_time; + uint32_t mcc_state; + uint32_t mcc_port_vec; + uint32_t mcc_port_vec_set; + uint32_t port_vec; + uint32_t port_vec_set; +}; + +enum { + M_NONE = 0, + M_OPTIONS = 1, + M_DESCRIBE = 2, + M_SETUP = 3, + M_PLAY = 4, + M_TEARDOWN = 5, + M_ERROR = 16, + M_UNKNOWN = 17, +}; + +struct oscon { + struct octoserve *os; + struct ossess *session; + int state; + pthread_t pt; + int sock; + int nr; + + struct ostrans trans; + + struct sockaddr cadr; + char cadr_ip[INET6_ADDRSTRLEN]; + socklen_t clen; + + struct sockaddr sadr; + char sadr_ip[INET6_ADDRSTRLEN]; + socklen_t slen; + + int seq; + int transport_parsed; + int session_parsed; + int x_octonet_parsed; + uint32_t x_ports; + int error; + + int cmd; + uint8_t buf[8192]; + uint32_t bufp; + int ln; + + struct dvb_params p; + + uint8_t url[8192]; +}; + +#define UPNP_DEV_MAX 10 + +struct upnp_dev { + char *nt; + char *loc; + char *uuid; + char *server; +}; + +struct os_ssdp { + struct octoserve *os; + pthread_t pt; + + int sock; + struct sockaddr sadr; + char ip[INET6_ADDRSTRLEN]; + + int sock6; + struct sockaddr sadr6; + char ip6[INET6_ADDRSTRLEN]; + + uint8_t uuid[16]; + char uuid_str[42]; + char uuid_str2[42]; + + struct sockaddr cadr; + uint16_t csport; + int csock; + int v6; + + int alive; + int bootid; + int configid; + uint8_t devid; + + char *server; + time_t annt; + + int setup; + time_t setupt; + + int http_sock; + struct sockaddr http_sadr; + + int http_sock6; + struct sockaddr http_sadr6; + + struct upnp_dev dev[UPNP_DEV_MAX]; + int dev_num; +}; + +struct os_http { + struct octoserve *os; + pthread_t pt; + + int sock; + struct sockaddr sadr; + char ip[INET6_ADDRSTRLEN]; + + int sock6; + struct sockaddr sadr6; + char ip6[INET6_ADDRSTRLEN]; + + struct sockaddr cadr; + int csock; +}; + +struct octoserve { + struct os_ssdp ssdp; + struct os_http http; + + int exit; + char *ifname; + uint8_t mac[6]; + + int scif_type; + int has_feswitch; + int do_feswitch; + + int dvbfe_num; + struct dvbfe dvbfe[MAX_DVB_FE]; + int dvbca_num; + struct dvbca dvbca[MAX_DVB_CA]; + uint32_t dvbs2num; + uint32_t dvbtnum; + uint32_t dvbt2num; + uint32_t dvbcnum; + uint32_t dvbc2num; + + struct oscon con[MAX_CONNECT]; + struct ossess session[MAX_SESSION]; + struct osstrm stream[MAX_STREAM]; + pthread_mutex_t lock; + pthread_mutex_t uni_lock; + pthread_t ci_pt; + + int rtsp_sock; + struct sockaddr rtsp_sadr; + char rtsp_ip[INET6_ADDRSTRLEN]; + + int rtsp_sock6; + struct sockaddr rtsp_sadr6; + char rtsp_ip6[INET6_ADDRSTRLEN]; + + uint32_t sessionid; + + int igmp_sock; + int igmp_rsock; + time_t igmp_time; + uint32_t igmp_mode; + uint32_t igmp_tag; + uint32_t igmp_timeout; + uint32_t igmp_robust; + + int mld_sock; + int has_switch; + int strict; +}; + +int streamsock(const char *port, int family, struct sockaddr *sadr); +void sockname(struct sockaddr *sadr, char *name); +int get_ifa(const char *ifname, int iffam, struct sockaddr *sadr); +int init_ssdp(struct octoserve *os, struct os_ssdp *ss, uint32_t d, int nossdp, int nodms); +int dvb_tune(struct dvbfe *fe, struct dvb_params *p); +int init_dvb(struct octoserve *os, int nodvbt, int noswitch); +int release_dvb(struct octoserve *os); +void parse_config(struct octoserve *os, char *sec, + void (*cb)(struct octoserve *, char *, char *)); +void handle_http(struct os_ssdp *ss); +void sadr2str(const struct sockaddr *sadr, char *s, size_t len); +void dump(const uint8_t *b, int l); + +void proc_igmp(struct octoserve *os, uint8_t *b, int l, uint8_t *mh); +void mc_join(struct octoserve *os, uint8_t *ip, uint8_t *mac, uint8_t *group); +void mc_leave(struct octoserve *os, uint8_t *ip, uint8_t *group); +void mc_check(struct ossess *sess); +void mc_del(struct ossess *sess); + +void send_igmp_query(struct octoserve *os, uint8_t *group, uint8_t timeout); +void check_igmp(struct octoserve *os); + +int switch_test(void); +int swich_get_port(uint8_t mac[6]); + +int sectest(void); +void handle_fe(struct dvbfe *fe); + +int set_pmt(struct dvbca *ca, uint32_t *pmt); + +int set_nonblock(int fd); +int sendlen(int sock, char *buf, int len); +int sendstring(int sock, char *fmt, ...); + +#endif diff --git a/octoserve/ssdp b/octoserve/ssdp new file mode 100644 index 0000000..94a09d3 --- /dev/null +++ b/octoserve/ssdp @@ -0,0 +1,6 @@ +SSDP: 192.168.2.177 +00: M-SEARCH * HTTP/1.1 +01: Host:239.255.255.250:1900 +02: Man:"ssdp:discover" +03: ST:urn:ses-com:device:SatIPServer:1 +04: MX:3 diff --git a/octoserve/ssdp.c b/octoserve/ssdp.c new file mode 100644 index 0000000..c23f1c4 --- /dev/null +++ b/octoserve/ssdp.c @@ -0,0 +1,697 @@ +/* + (C) 2012-14 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#include "octoserve.h" + +extern struct rtsp_error rtsp_errors; + +extern uint32_t debug; + +static void ssdp_reset_setup(struct os_ssdp *ss) +{ + ss->setup = 0; + time(&ss->setupt); + ss->setupt += 5; + time(&ss->annt); +} + +static int read_id(char *type, uint32_t *id) +{ + int fd, len; + char name[80]; + + len = snprintf(name, 80, "/config/%s.id", type); + if (len < 0 || len == 80) + return -1; + fd = open(name, O_RDONLY); + if (fd < 0) + return -1; + printf("read id from %s\n", name); + len = read(fd, name, 80); + name[len] = 0; + *id = strtol(name, NULL, 10); + printf("%s.id = %d\n", type, *id); + return 0; +} + +static int write_id(char *type, uint32_t id) +{ + int fd, len; + char name[80]; + + len = snprintf(name, 80, "/config/%s.id", type); + if (len < 0 || len == 80) + return -1; + fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 00644); + if (fd < 0) + return -1; + printf("write id = %d to %s\n", id, name); + len = snprintf(name, 80, "%d", id); + write(fd, name, len); + close(fd); + return 0; +} + +static int ssdp_msg(struct os_ssdp *ss, char *buf, int n, int notify, int nr, int v6, int send_id) +{ + int len; + uint8_t *u = ss->uuid; + char uuid[37]; + char *header = notify ? + "NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\n" : + "HTTP/1.1 200 OK\r\n"; + char id[32]; + + if (send_id) { + len = snprintf(id, sizeof(id), + "DEVICEID.SES.COM: %d", + ss->devid); + if (len < 0 || len >= sizeof(id)) + return -1; + } else + id[0] = 0; + + if (ss->alive) { + len = snprintf(buf, n, + "%s" + "CACHE-CONTROL: max-age=1800\r\n" + "LOCATION: http://%s%s\r\n" + "NT: %s\r\n" + "NTS: ssdp:%s\r\n" + "SERVER: %s\r\n" + "USN: %s%s%s\r\n" + "BOOTID.UPNP.ORG: %d\r\n" + "CONFIGID.UPNP.ORG: %d\r\n" + "%s\r\n" + "\r\n", + header, + v6 ? ss->ip6 : ss->ip, + ss->dev[nr].loc, + ss->dev[nr].nt[0] ? ss->dev[nr].nt : ss->dev[nr].uuid, + "alive", + ss->dev[nr].server, + ss->dev[nr].uuid, ss->dev[nr].nt[0] ? "::" : "", ss->dev[nr].nt, + ss->bootid, ss->configid, + id + ); + } else { + dbgprintf(DEBUG_SSDP, "BYEBYE\n"); + + len = snprintf(buf, n, + "%s" + "NT: %s\r\n" + "NTS: ssdp:byebye\r\n" + "USN: %s%s%s\r\n" + "BOOTID.UPNP.ORG: %d\r\n" + "CONFIGID.UPNP.ORG: %d\r\n" + "\r\n", + header, + ss->dev[nr].nt[0] ? ss->dev[nr].nt : ss->dev[nr].uuid, + ss->dev[nr].uuid, ss->dev[nr].nt[0] ? "::" : "", ss->dev[nr].nt, + ss->bootid, ss->configid + ); + + } + return len; +} + +static int sendto_port(int sock, const void *buf, size_t len, + struct sockaddr_in *cadr, uint16_t port) +{ + struct sockaddr_in adr = *cadr; + + adr.sin_port = htons(port); + return sendto(sock, buf, len, 0, (struct sockaddr *) &adr, sizeof(adr)); +} + +static int send_ssdp_msg(struct os_ssdp *ss, int nr, int notify) +{ + uint8_t buf[2048]; + int len; + + len = ssdp_msg(ss, buf, sizeof(buf), notify, nr, 0, nr < 3); + + if (len < 0 || len >= sizeof(buf)) + return -1; + if (notify) { + struct sockaddr_in insadr; + + memset(&insadr, 0, sizeof(insadr)); + insadr.sin_family = AF_INET; + insadr.sin_port = htons(1900); + insadr.sin_addr.s_addr = inet_addr("239.255.255.250"); + return sendto(ss->sock, buf, len, 0, (struct sockaddr *) &insadr, sizeof(insadr)); + } else + return sendto(ss->sock, buf, len, 0, &ss->cadr, sizeof(struct sockaddr)); +} + +static int ssdp_announce(struct octoserve *os, int alive, int notify) +{ + struct os_ssdp *ss = &os->ssdp; + uint8_t buf[2048]; + int len, nr, res; + int s = os->ssdp.sock; + uint8_t *u = ss->uuid; + time_t t; + + if (notify) { + time(&t); + if (!ss->setup) + if (t >= ss->setupt) { + ss->setup = 1; + dbgprintf(DEBUG_SSDP, "END SSDP SETUP\n"); + } + if (ss->alive == alive && t < ss->annt) + return 0; + ss->alive = alive; + ss->annt = t + 900; //FIXME: +/- random + } + for (nr = 0; nr < ss->dev_num; nr++) { + send_ssdp_msg(ss, nr, notify); + } +} + +static int ssdp_defend(struct os_ssdp *ss) +{ + char buf[2048], host[64]; + int len; + int s = ss->v6 ? ss->sock6 : ss->sock; + + sockname(&ss->cadr, host); + printf("defend against HOST:%s\n", host); + + len = snprintf(buf, sizeof(buf), + "M-SEARCH * HTTP/1.1\r\n" + "HOST: %s:1900\r\n" + "MAN: \"ssdp:discover\"\r\n" + "ST: urn:ses-com:device:SatIPServer:1\r\n" + "USER-AGENT: %s\r\n" + "DEVICEID.SES.COM: %d\r\n" + "\r\n", + ss->v6 ? ss->ip6 : ss->ip, + ss->server, + ss->devid); + if (len < 0 || len >= sizeof(buf)) + return -1; + return sendto(s, buf, len, 0, &ss->cadr, sizeof(ss->cadr)); + //return sendto_port(ss->sock, buf, len, &ss->cadr, ss->csport); +} + +static int send_reply_msearch(struct os_ssdp *ss, int mc, int send_id, int nr) +{ + char buf[2048], id[32]; + int len, res; + int v6 = ss->v6; + int s = v6 ? ss->sock6 : ss->sock; + + dbgprintf(DEBUG_SSDP, "send msearch reply nr=%d\n", nr); + if (send_id) { + len = snprintf(id, sizeof(id), + "DEVICEID.SES.COM: %d\r\n", + ss->devid); + if (len < 0 || len >= sizeof(id)) + return -1; + } else + id[0] = 0; + len = snprintf(buf, sizeof(buf), + "HTTP/1.1 200 OK\r\n" + "CACHE-CONTROL: max-age=1800\r\n" + "EXT:\r\n" + "LOCATION: http://%s%s\r\n" + "SERVER: %s\r\n" + "ST: %s\r\n" + "USN: %s%s%s\r\n" + "BOOTID.UPNP.ORG: %d\r\n" + "CONFIGID.UPNP.ORG: %d\r\n" + "%s" + "\r\n", + ss->v6 ? ss->ip6 : ss->ip, + ss->dev[nr].loc, + ss->dev[nr].server, + ss->dev[nr].nt[0] ? ss->dev[nr].nt : ss->dev[nr].uuid, + ss->dev[nr].uuid, ss->dev[nr].nt[0] ? "::" : "", ss->dev[nr].nt, + ss->bootid, ss->configid, id + ); + if (len < 0 || len >= sizeof(buf)) + return -1; + dbgprintf(DEBUG_SSDP, "sending:\n%s", buf); + if (mc) { + struct sockaddr_in insadr; + + memset(&insadr, 0, sizeof(insadr)); + insadr.sin_family = AF_INET; + insadr.sin_port = htons(1900); + insadr.sin_addr.s_addr = inet_addr("239.255.255.250"); + res = sendto(s, buf, len, 0, (struct sockaddr *) &insadr, sizeof(insadr)); + } else + res = sendto(s, buf, len, 0, &ss->cadr, sizeof(struct sockaddr)); + //res = sendto_port(ss->sock, buf, len, &ss->cadr, ss->csport); + return res; +} + +static int ssdp_msearch(struct os_ssdp *ss, int mc, char *st) +{ + int nr, len = strlen(st), type = 0; + uint8_t *u = ss->uuid; + + if (!len) + return 0; + if (!strncasecmp(st, "ssdp:all", 8)) + type = 1; + else if (!strncasecmp(st, "uuid:", 5)) + type = 2; + dbgprintf(DEBUG_SSDP, "msearch mc=%u, st=%s (type=%u)\n", mc, st, type); + + for (nr = 0; nr < ss->dev_num; nr++) { + if ((type == 1) || + ((type == 2) && !ss->dev[nr].nt[0] && + !strncasecmp(ss->dev[nr].uuid, st, len)) || + ((type == 0) && !strncasecmp(ss->dev[nr].nt, st, len))) + send_reply_msearch(ss, mc, nr < 3, nr); + } + return 0; +} + +static void handle_ssdp(struct octoserve *os, char *m, int ml) +{ + struct os_ssdp *ss = &os->ssdp; + int ln, ll, tl, as, al; + char *l, *le, *me = m + ml, *st = NULL; + int type = 0; + int htype = 0; + int devid = -1; + int mx = -1; + uint8_t uu[16]; + char host[64]; + char str[INET_ADDRSTRLEN]; + int sport = 1900, hport = 1900; + + dbgprintf(DEBUG_SSDP, + "\n********************************************************************************\n"); + inet_ntop(AF_INET, &((struct sockaddr_in *) &ss->cadr)->sin_addr, str, INET_ADDRSTRLEN); + dbgprintf(DEBUG_SSDP, "\nSSDP: %s\n", str); + + memset(uu, 0, 16); + + for (l = m, ln = -1; l < me; l += ll + 1) { + for (le = l; *le != '\r' && *le != '\n' && le < me; le++); + ll = le - l; + if (!ll) + continue; + *le = 0; + ln++; + dbgprintf(DEBUG_SSDP, "%02d: %s\n", ln, l); + if (ln == 0) { + if (!strncasecmp(l, "M-SEARCH * HTTP/1.1", ll)) { + type = 1; + continue; + } + if (!strncasecmp(l, "NOTIFY * HTTP/1.1", ll)) { + type = 2; + continue; + } + if (!strncasecmp(l, "HTTP/1.1 200 OK", ll)) { + type = 3; + continue; + } + dbgprintf(DEBUG_SSDP, "unknown header\n"); + return; + } + for (tl = 0; tl < ll && l[tl] != ':'; tl++); + if (tl == ll) + return; + for (as = tl + 1; as < ll && isspace(l[as]); as++); + al = ll - as; + + if (tl == 4 && !strncasecmp(l, "HOST", 4)) { + char *h, *p; + + if (!strncmp(l + as, "239.255.255.250:1900", al)) + htype = 1; + else + htype = 2; + h = host; + p = l + as; + while (*p && *p != ':') + *(h++) = *(p++); + *h = 0; + p++; + hport = atoi(p); + } + if (tl == 2 && !strncasecmp(l, "MX", tl)) { + mx = atoi(l + as); + continue; + } + if (tl == 2 && !strncasecmp(l, "ST", tl)) { + st = l + as; + continue; + } + if (tl == 16 && !memcmp(l, "DEVICEID.SES.COM", tl)) { + devid = atoi(l + as); + //dbgprintf(DEBUG_SSDP, "sat>ip device id %d\n", devid); + continue; + } + if (tl = 19 && !memcmp(l, "SEARCHPORT.UPNP.ORG", tl)) { + sport = atoi(l + as); + dbgprintf(DEBUG_SSDP, "searchport %d\n", sport); + continue; + } + if (tl == 3 && !memcmp(l, "USN", tl) && !memcmp(l+5, "uuid:", 5)) { + int n; + + //printf("USN: %s\n", l+5); + sscanf(l+10, "%2hhx%2hhx%2hhx%2hhx-%2hhx%2hhx-" + "%2hhx%2hhx-%2hhx%2hhx-%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%n", + &uu[0], &uu[1], &uu[2], &uu[3], + &uu[4], &uu[5], &uu[6], &uu[7], + &uu[8], &uu[9], &uu[10], &uu[11], + &uu[12], &uu[13], &uu[14], &uu[15], &n); + /* ignore message from myself */ + if (!memcmp(uu, ss->uuid, 16)) + dbgprintf(DEBUG_SSDP, "that's me!\n"); + continue; + } + } + ss->csport = sport; + dbgprintf(DEBUG_SSDP, "host=%s, hport=%u, type=%d, htype=%d mx=%d\n", host, hport, type, htype, mx); + /* M-SEARCH */ + if (ss->setup) { + if (type == 1 && mx > 0) { + ssdp_msearch(ss, 0, st); + } + /* NOTIFY */ + if (type == 2 && devid == ss->devid && memcmp(uu, ss->uuid, 16)) { + ssdp_defend(ss); + } + } else { + if (type == 1 && htype == 2 && ss->devid == devid) { + send_reply_msearch(ss, 0, 1, 2); + ss->devid++; + write_id("device", ss->devid); + dbgprintf(DEBUG_SSDP, "new device id %d \n", ss->devid); + ssdp_reset_setup(ss); + } + } +} + + +#define SSDP_MCAST "239.255.255.250" +#define SSDP_MCAST_LL "FF02::C" +#define SSDP_MCAST_SL "FF05::C" + +static int ssdp_mc_add(int s, const char *ifname, int add, int v6) +{ + if (v6) { + struct ipv6_mreq imr; + unsigned int ifindex = if_nametoindex(ifname); + + memset(&imr, 0, sizeof(imr)); + inet_pton(AF_INET6, SSDP_MCAST_LL, &imr.ipv6mr_multiaddr); + imr.ipv6mr_interface = ifindex; + if (setsockopt(s, IPPROTO_IPV6, add ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP, + &imr, sizeof(imr)) < 0) + return -1; + inet_pton(AF_INET6, SSDP_MCAST_SL, &imr.ipv6mr_multiaddr); + if (setsockopt(s, IPPROTO_IPV6, add ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP, + &imr, sizeof(imr)) < 0) + return -1; + } else { + struct ip_mreq imr; + struct sockaddr_in sadr; + unsigned char ttl = 2, one = 1, zero = 0; + + get_ifa(ifname, AF_INET, (struct sockaddr *) &sadr); + imr.imr_multiaddr.s_addr = inet_addr(SSDP_MCAST); + imr.imr_interface.s_addr = sadr.sin_addr.s_addr; + + if (setsockopt(s, IPPROTO_IP, add ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP, + &imr, sizeof(imr)) < 0) + return -1; + setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); + //setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &zero, sizeof(zero)); + } + printf("mc_add OK\n"); + return 0; +} + +static int ssdpsock(const char *ifnam, int family, struct sockaddr *sadr) +{ + int one=1, sock; + struct addrinfo *ais, *ai, hints = { + .ai_flags = AI_PASSIVE, + .ai_family = family, + .ai_socktype = SOCK_DGRAM, + .ai_protocol = 0, + .ai_addrlen = 0, + .ai_addr = sadr, + .ai_canonname = NULL, + .ai_next = NULL, + }; + + if (getaddrinfo(NULL, "1900", &hints, &ais) < 0) + return -1; + for (ai = ais; ai; ai = ai->ai_next) { + sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); + if (sock == -1) + continue; + //dump(ai->ai_addr, sizeof(*ai->ai_addr)); + if (!setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) && + !bind(sock, ai->ai_addr, ai->ai_addrlen)) + break; + close(sock); + } + freeaddrinfo(ais); + ssdp_mc_add(sock, ifnam, 1, family == AF_INET6 ? 1 : 0); + return sock; +} + +static void add_fd(int fd, int *mfd, fd_set *fds) +{ + FD_SET(fd, fds); + if (fd > *mfd) + *mfd = fd; +} + +static void ssdp_loop(struct octoserve *os) +{ + struct os_ssdp *ss = &os->ssdp; + int num; + int mfd; + fd_set fds; + struct timeval timeout; + char buf[1501]; + + ss->http_sock = streamsock("8888", AF_INET, &ss->http_sadr); + if (listen(ss->http_sock, 10) < 0) { + printf("listen error"); + return; + } + ssdp_reset_setup(ss); + + while (!os->exit) { + ssdp_announce(os, 1, 1); + + timeout.tv_sec = 1; + timeout.tv_usec = 0; + + FD_ZERO(&fds); + mfd = 0; + add_fd(ss->sock, &mfd, &fds); + //add_fd(ss->sock6, &mfd, &fds); + add_fd(ss->http_sock, &mfd, &fds); + + num = select(mfd + 1, &fds, NULL, NULL, &timeout); + if (num < 0) + break; + if (FD_ISSET(ss->sock, &fds)) { + socklen_t len; + int n; + + len = sizeof(ss->cadr); + n = recvfrom(ss->sock, buf, sizeof(buf) - 1, 0, &ss->cadr, &len); + ss->v6 = 0; + if (n > 0) + handle_ssdp(os, buf, n); + } + if (FD_ISSET(ss->http_sock, &fds)) { + socklen_t len; + pthread_t pt; + + //ss->csock = accept4(ss->http_sock, &ss->cadr, &len, SOCK_NONBLOCK); + ss->csock = accept(ss->http_sock, &ss->cadr, &len); + handle_http(ss); + } + } + ssdp_announce(os, 0, 1); +} + +static void ssdp_search(int s) +{ + struct sockaddr_in insadr; + char ms[] = "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\n" + "MAN: \"ssdp:discover\"\r\nMX: 5\r\nST: ssdp:all\r\n\r\n"; + + memset(&insadr, 0, sizeof(insadr)); + insadr.sin_family = AF_INET; + insadr.sin_port = htons(1900); + insadr.sin_addr.s_addr = inet_addr("239.255.255.250"); + sendto(s, &ms[0], sizeof(ms) - 1, 0, + (struct sockaddr *) &insadr, sizeof(insadr)); +} + +void ssdp_thread(struct octoserve *os) +{ + //ssdp_search(s); + ssdp_loop(os); +} + +static uint64_t get_us(void) +{ + struct timeval tv; + gettimeofday(&tv, 0); + return ((uint64_t) tv.tv_sec * 1000000ULL + (uint64_t) tv.tv_usec); +} + +static void create_uuid(uint8_t *u, uint8_t *mac) +{ + uint8_t uu[10] = { 0xdd, 0x84, 0x8d, 0x00, 0x26, + 0xec, 0x11, 0xeb, 0x80, 0x00 }; + + memcpy(u, uu, 10); + memcpy(u + 10, mac, 6); +} + +static void create_uuid_old(uint8_t *u, uint8_t *mac) +{ + uint64_t us, ns; + int i; + + memcpy(u + 10, mac, 6); + + us = get_us(); + ns = us * 1000ULL + 122192928000000000ULL; + + u[0] = ns >> 24; + u[1] = ns >> 16; + u[2] = ns >> 8; + u[3] = ns; + u[4] = ns >> 40; + u[5] = ns >> 32; + u[6] = ns >> 56; + u[7] = ns >> 48; + + u[8] = 0; + u[9] = 0; + + u[6] = (u[6] & 0x0f) | 0x10; + u[8] = (u[8] & 0x3f) | 0x80; +} + +static int add_dev(struct os_ssdp *ss, char *nt, char *loc, char *uuid, char *server) +{ + int n = ss->dev_num; + + if (n == UPNP_DEV_MAX) + return -1; + ss->dev[n].nt = nt; + ss->dev[n].loc = loc; + ss->dev[n].uuid = uuid; + ss->dev[n].server = server; + ss->dev_num++; +} + + +int init_ssdp(struct octoserve *os, struct os_ssdp *ss, uint32_t d, int nossdp, int nodms) +{ + time_t t; + uint8_t *u, mac[6]; + struct ifreq ifr; + uint32_t id; + int stat; + char *dms = "Linux/3.17.7 DLNADOC/1.50 UPnP/1.0 OctopusNet-DMS/1.0"; + + debug = d; + ss->os = os; + ss->server = "Linux/3.17.7 UPnP/1.1 OctopusNet/" OCTOSERVE_VERSION; + stat = read_id("device", &id); + if (stat < 0) { + ss->devid = 5; + write_id("device", ss->devid); + } else + ss->devid = id; + stat = read_id("boot", &id); + if (stat < 0) + ss->bootid = 0; + else + ss->bootid = id + 1; + write_id("boot", ss->bootid); + + ss->configid = 1; + + get_ifa(os->ifname, AF_INET, &os->ssdp.sadr); + get_ifa(os->ifname, AF_INET6, &os->ssdp.sadr6); + sockname(&os->ssdp.sadr, os->ssdp.ip); + sockname(&os->ssdp.sadr6, os->ssdp.ip6); + + if (!nossdp) { + ss->sock = ssdpsock(os->ifname, AF_INET, &os->ssdp.sadr); + if (ss->sock < 0) + return -1; + + ss->sock6 = ssdpsock(os->ifname, AF_INET6, &os->ssdp.sadr); + if (ss->sock6 < 0) + return -1; + + strcpy(ifr.ifr_name, os->ifname); + ioctl(ss->sock, SIOCGIFHWADDR, &ifr); + memcpy(mac, ifr.ifr_hwaddr.sa_data, 6); + + create_uuid(ss->uuid, mac); + u = ss->uuid; + + snprintf(ss->uuid_str, 42, + "uuid:%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], + u[8], u[9], u[10], u[11], u[12], u[13], u[14], u[15]); + + snprintf(ss->uuid_str2, 42, + "uuid:f0287290-e1e1-11e2-9a21-%02x%02x%02x%02x%02x%02x", + u[10], u[11], u[12], u[13], u[14], u[15]); + + add_dev(ss, "upnp:rootdevice", "/octoserve/octonet.xml", ss->uuid_str, ss->server); + add_dev(ss, "", "/octoserve/octonet.xml", ss->uuid_str, ss->server); + add_dev(ss, "urn:ses-com:device:SatIPServer:1", "/octoserve/octonet.xml", + ss->uuid_str, ss->server); + + if (!nodms) { + add_dev(ss, "upnp:rootdevice", ":8080/dms.xml", ss->uuid_str2, dms); + add_dev(ss, "", ":8080/dms.xml", ss->uuid_str2, dms); + add_dev(ss, "urn:schemas-upnp-org:device:MediaServer:1", ":8080/dms.xml", + ss->uuid_str2, dms); + add_dev(ss, "urn:schemas-upnp-org:service:ConnectionManager:1", + ":8080/dms.xml", ss->uuid_str2, dms); + add_dev(ss, "urn:schemas-upnp-org:service:ContentDirectory:1", + ":8080/dms.xml", ss->uuid_str2, dms); + add_dev(ss, "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1", + ":8080/dms.xml", ss->uuid_str2, dms); + } + pthread_create(&os->ssdp.pt, NULL, (void *) ssdp_thread, os); + } + return 0; +} diff --git a/octoserve/switch.c b/octoserve/switch.c new file mode 100644 index 0000000..5a0227d --- /dev/null +++ b/octoserve/switch.c @@ -0,0 +1,196 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "octoserve.h" + +extern uint32_t debug; + +int readreg(int fd, uint32_t reg, uint32_t *val) +{ + struct ddb_reg ddbreg = { .reg = reg }; + int ret; + + ret = ioctl(fd, IOCTL_DDB_READ_REG, &ddbreg); + if (ret < 0) + return ret; + if (val) + *val = ddbreg.val; + return 0; +} + +int writereg(int fd, uint32_t reg, uint32_t val) +{ + struct ddb_reg ddbreg = { .reg = reg, .val = val}; + + return ioctl(fd, IOCTL_DDB_WRITE_REG, &ddbreg); +} + +uint16_t mdio_readreg(int fd, uint8_t adr, uint8_t reg, uint16_t *val) +{ +#if 0 + uint32_t tmp; + + writereg(fd, 0x24, adr); + writereg(fd, 0x28, reg); + writereg(fd, 0x20, 0x07); + do { + readreg(fd, 0x20, &tmp); + } while (tmp & 0x02); + readreg(fd, 0x2c, &tmp); + *val = tmp; +#else + struct ddb_mdio mdio = { .adr = adr, .reg = reg}; + ioctl(fd, IOCTL_DDB_READ_MDIO, &mdio); + *val = mdio.val; +#endif + return *val; +} + +int mdio_writereg(int fd, uint8_t adr, uint8_t reg, uint16_t val) +{ +#if 0 + uint32_t tmp = val; + + writereg(fd, 0x24, adr); + writereg(fd, 0x28, reg); + writereg(fd, 0x2c, tmp); + writereg(fd, 0x20, 0x03); + do { + readreg(fd, 0x20, &tmp); + } while (tmp & 0x02); + return 0; +#else + struct ddb_mdio mdio = { .adr = adr, .reg = reg, .val = val}; + return ioctl(fd, IOCTL_DDB_WRITE_MDIO, &mdio); +#endif +} + +int mdio_wait_switch(int fd, uint8_t adr, uint8_t reg) +{ + uint16_t val; + + do { + mdio_readreg(fd, adr, reg, &val); + } while (val & 0x8000); +} + +int mdio_open() +{ + return open("/dev/ddbridge/card0", O_RDWR); +} + +int mdio_close(int fd) +{ + close(fd); +} + +int switch_get_port(uint8_t mac[6]) +{ + int fd = mdio_open(); + uint16_t vector, state; + uint16_t r0c, aw1, aw2, aw3; + uint16_t w1, w2, w3; + uint64_t m = ((uint64_t) mac[0] << 40) | ((uint64_t) mac[1] << 32) | ((uint64_t) mac[2] << 24) | + ((uint64_t) mac[3] << 16) | ((uint64_t) mac[4] << 8) | (uint64_t) mac[5]; + w1 = (mac[0] << 8) | mac[1]; + w2 = (mac[2] << 8) | mac[3]; + w3 = (mac[4] << 8) | mac[5]; + + m--; + mdio_writereg(fd, 0x1b, 0x0d, (m >> 32) & 0xffff); + mdio_writereg(fd, 0x1b, 0x0e, (m >> 16) & 0xffff); + mdio_writereg(fd, 0x1b, 0x0f, (m >> 0) & 0xffff); + mdio_writereg(fd, 0x1b, 0x0b, 0xc000); + mdio_wait_switch(fd, 0x1b, 0x0b); + mdio_readreg(fd, 0x1b, 0x0c, &r0c); + + if (!(r0c & 0x0f)) { + mdio_close(fd); + return -1; + } + vector = (r0c >> 4) & 0x7f; + state = r0c & 0x0f; + + mdio_readreg(fd, 0x1b, 0x0d, &aw1); + mdio_readreg(fd, 0x1b, 0x0e, &aw2); + mdio_readreg(fd, 0x1b, 0x0f, &aw3); + mdio_close(fd); + + if (w1 == aw1 && w2 == aw2 && w3 == aw3) { + dbgprintf(DEBUG_SWITCH, "%02x: %02x:%02x:%02x:%02x:%02x:%02x %d\n", + vector, + aw1 >> 8, aw1 & 0xff, + aw2 >> 8, aw2 & 0xff, + aw3 >> 8, aw3 & 0xff, + state); + return vector; + } + return -1; +} + +int switch_set_multicast(uint8_t mac[6], uint8_t vec) +{ + int fd = mdio_open(); + + dbgprintf(DEBUG_SWITCH, "switch_set_multicast %02x:%02x:%02x:%02x:%02x:%02x = %02x\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], vec); + if (fd < 0) + return -1; + if (vec) + mdio_writereg(fd, 0x1b, 0x0c, (vec << 4) | 7); + else + mdio_writereg(fd, 0x1b, 0x0c, 0); + mdio_writereg(fd, 0x1b, 0x0d, ((uint16_t) mac[0] << 8) | mac[1]); + mdio_writereg(fd, 0x1b, 0x0e, ((uint16_t) mac[2] << 8) | mac[3]); + mdio_writereg(fd, 0x1b, 0x0f, ((uint16_t) mac[4] << 8) | mac[5]); + mdio_writereg(fd, 0x1b, 0x0b, 0xb000); + mdio_wait_switch(fd, 0x1b, 0x0b); + mdio_close(fd); + return 0; +} + +int switch_test(void) +{ + int fd = mdio_open(); + int res; + + res = mdio_writereg(fd, 0x1b, 0x0d, 0xffff); + if (res < 0) + return 0; + mdio_writereg(fd, 0x1b, 0x0e, 0xffff); + mdio_writereg(fd, 0x1b, 0x0f, 0xffff); + + while (1) { + uint16_t r0c, aw1, aw2, aw3; + uint16_t vector, state; + + mdio_writereg(fd, 0x1b, 0x0b, 0xc000); + mdio_wait_switch(fd, 0x1b, 0x0b); + mdio_readreg(fd, 0x1b, 0x0c, &r0c); + if (!(r0c & 0x0f)) + break; + vector = (r0c >> 4) & 0x7f; + state = r0c & 0x0f; + + mdio_readreg(fd, 0x1b, 0x0d, &aw1); + mdio_readreg(fd, 0x1b, 0x0e, &aw2); + mdio_readreg(fd, 0x1b, 0x0f, &aw3); + + dbgprintf(DEBUG_SWITCH, "%02x: %02x:%02x:%02x:%02x:%02x:%02x %d\n", + vector, + aw1 >> 8, aw1 & 0xff, + aw2 >> 8, aw2 & 0xff, + aw3 >> 8, aw3 & 0xff, + state); + } + mdio_close(fd); + return 1; +} diff --git a/octoserve/var/channels/DataBase.lua b/octoserve/var/channels/DataBase.lua new file mode 100644 index 0000000..5e595f9 --- /dev/null +++ b/octoserve/var/channels/DataBase.lua @@ -0,0 +1,130 @@ + +local DataBase = {} + +local SourceList = {} +local ChannelList = {} + +local function AddSource(refid,title,system,src) + table.insert(SourceList, { refid = refid, title = title, src = src, system = system } ) +end + +local function AddChannel(sourceid,title,request,tracks) + table.insert(ChannelList, { refid = sourceid, title = title, request = request, tracks = tracks } ) +end + +local function ReadFile(sourceid,file,system) + while true do + line = file:read() + if not line then break end + local cat,title,sys,freq,sr,pol,mtype,bw,ds,plp,t2lite,radio,enc,pids,tracks + local request = "" + + if system == "dvbs" or system == "dvbs2" then + cat,title,sys,freq,sr,pol,radio,enc,pids,tracks = string.match(line,'%"(.*)%",%"(.*)%",%"(.*)%",(%d+),(%d+),%"(.*)%",(%d+),(%d+),%"P(.*)%",%"A(.*)%"') + if not tracks then break end + if sys == "dvbs" or "dvbs2" then + pids = string.gsub(pids,":",",") + tracks = string.gsub(tracks,":",",") + request = "freq="..freq.."&pol="..pol.."&msys="..sys.."&sr="..sr.."&pids=0,"..pids + end + elseif system == "dvbc" then + cat,title,sys,freq,sr,mtype,radio,enc,pids,tracks = string.match(line,'%"(.*)%",%"(.*)%",%"(.*)%",(%d+),(%d+),%"(.*)%",(%d+),(%d+),%"P(.*)%",%"A(.*)%"') + if not tracks then break end + pids = string.gsub(pids,":",",") + tracks = string.gsub(tracks,":",",") + local f = string.sub(freq,1,3).."."..string.sub(freq,4,6) + if sys == "dvbc" then + request = "freq="..f.."&msys=dvbc&sr="..sr.."&mtype="..mtype.."&pids=0,"..pids + end + elseif system == "dvbc2" then + cat,title,sys,freq,bw,ds,plp,mtype,radio,enc,pids,tracks = string.match(line,'%"(.*)%",%"(.*)%",%"(.*)%",(%d+),(%d+),(%d+),(%d+),%"(.*)%",(%d+),(%d+),%"P(.*)%",%"A(.*)%"') + if not tracks then break end + pids = string.gsub(pids,":",",") + tracks = string.gsub(tracks,":",",") + local f = string.sub(freq,1,3).."."..string.sub(freq,4,6) + if sys == "dvbc" then + request = "freq="..f.."&msys=dvbc&sr="..bw.."&mtype="..ds.."&pids=0,"..pids + elseif sys == "dvbc2" then + request = "freq="..f.."&msys=dvbc2&bw="..bw.."&x_ds="..ds.."&plp="..plp.."&pids=0,"..pids + end + elseif system == "dvbt" or system == "dvbt2" then + cat,title,sys,freq,bw,plp,t2lite,radio,enc,pids,tracks = string.match(line,'%"(.*)%",%"(.*)%",%"(.*)%",(%d+),(%d+),(%d+),(%d+),(%d+),(%d+),%"P(.*)%",%"A(.*)%"') + if not tracks then break end + pids = string.gsub(pids,":",",") + tracks = string.gsub(tracks,":",",") + local f = string.sub(freq,1,3).."."..string.sub(freq,4,6) + if sys == "dvbt" then + request = "freq="..f.."&msys=dvbt&bw="..bw.."&pids=0,"..pids + elseif sys == "dvbt2" then + if bw == "1" then bw = "1.712" end + request = "freq="..f.."&msys=dvbt2&bw="..bw.."&plp="..plp.."&pids=0,"..pids + end + end + + if request ~= "" then + if enc ~= "0" then request = request.."&x_pmt="..enc end + AddChannel(sourceid,title,request, tracks) + end + end + + file:close() +end + +local function OpenCSV(name,line1) + local file = io.open("/config/channels/"..name..".csv","r") + if file then + local line = file:read() + line = string.gsub(line,'"','') + if string.match(line,line1) then + return file + end + file:close() + end + file = io.open("/var/channels/"..name..".csv","r") + if file then + local line = file:read() + end + return file +end + +local srcfile = OpenCSV("sourcelist","KEY,CSVFILE,NAME,SYSTEM,SRC") +if srcfile then + while true do + line = srcfile:read() + if not line then break end + local key,csvfile,name,system,src = string.match(line,'%"(.*)%",%"(.*)%",%"(.*)%",%"(.*)%",(%d+)') + if not key or not csvfile or not name or not system or not src then + break + end + if system == "dvbs" or system == "dvbs2" then + AddSource(key,name,system,src) + elseif system == "dvbc" or system == "dvbc2" or system == "dvbt" or system == "dvbt2" then + AddSource(key,name,system,nil) + else + csvfile = nil + end + if csvfile then + local header = "?" + if system == "dvbs" or system == "dvbs2" then + header = "CATEGORY,TITLE,SYSTEM,FREQ,SR,POL,RADIO,ENC,PIDS,TRACKS" + elseif system == "dvbc" then + header = "CATEGORY,TITLE,SYSTEM,FREQ,SR,MOD,RADIO,ENC,PIDS,TRACKS" + elseif system == "dvbc2" then + header = "CATEGORY,TITLE,SYSTEM,FREQ,BW/SR,DS,PLP,MOD,RADIO,ENC,PIDS,TRACKS" + elseif system == "dvbt" or system == "dvbt2" then + header = "CATEGORY,TITLE,SYSTEM,FREQ,BW,PLP,LITE,RADIO,ENC,PIDS,TRACKS" + end + + local file = OpenCSV(csvfile,header) + if file then + ReadFile(key,file,system) + end + end + end + srcfile:close() +end + +DataBase.SourceList = SourceList +DataBase.ChannelList = ChannelList + +return DataBase \ No newline at end of file diff --git a/octoserve/var/channels/a19e.csv b/octoserve/var/channels/a19e.csv new file mode 100644 index 0000000..ad745db --- /dev/null +++ b/octoserve/var/channels/a19e.csv @@ -0,0 +1,523 @@ +CATEGORY,TITLE,SYSTEM,FREQ,SR,POL/MOD,RADIO,ENC,PIDS,TRACKS +"Unknown","Service 30818","dvbs2",10729,22000,"v",0,0,"P1042:169:134:135","A134:135" +"Unknown","Service 30819","dvbs2",10729,22000,"v",0,0,"P1043:171:146:147","A146:147" +"ARD","tagesschau24","dvbs",10743,22000,"h",0,0,"P100:101:104:102","A102" +"ARD","Einsfestival","dvbs",10743,22000,"h",0,0,"P200:201:204:202:203:206","A202:203:206" +"ARD","EinsPlus","dvbs",10743,22000,"h",0,0,"P300:301:304:302:303:306","A302:303:306" +"ARD","arte","dvbs",10743,22000,"h",0,0,"P400:401:404:402:403:407:408","A402:403:407:408" +"ARD","PHOENIX","dvbs",10743,22000,"h",0,0,"P500:501:504:502:503","A502:503" +"ARD","Test-R","dvbs",10743,22000,"h",0,0,"P600:401:402","A402" +"PRISA TV","LTC","dvbs",10758,22000,"v",0,0,"P1027:163:92","A92" +"Unknown","Service 29862","dvbs",10758,22000,"v",0,0,"P1036:4166","A" +"BetaDigital","ANIXE HD","dvbs2",10773,22000,"h",0,0,"P96:255:259","A259" +"BetaDigital","QVC HD","dvbs2",10773,22000,"h",0,0,"P99:1023:35:1027","A1027" +"BetaDigital","HSE24 HD","dvbs2",10773,22000,"h",0,0,"P100:1279:36:1283","A1283" +"BetaDigital","SES 75","dvbs2",10773,22000,"h",0,0,"P106:2815","A" +"BetaDigital","SOPHIA TV","dvbs2",10773,22000,"h",0,0,"P107:3071:3072","A3072" +"PRISA TV","TAQUILLA X","dvbs",10788,22000,"v",0,0,"P1035:173:132:144","A132:144" +"TXY","TAQUILLA XY","dvbs",10788,22000,"v",0,0,"P1031:160:80:81","A80:81" +"PRISA TV","TAQUILLA X","dvbs",10788,22000,"v",0,0,"P1036:174:136:145","A136:145" +"BetaDigital","HSE24 EXTRA HD","dvbs2",10802,22000,"h",0,0,"P97:511:33:515","A515" +"BetaDigital","1-2-3.tv HD","dvbs2",10802,22000,"h",0,0,"P98:767:34:771","A771" +"BetaDigital","QVC PLUS HD","dvbs2",10802,22000,"h",0,0,"P100:1279:36:1283","A1283" +"Unknown","Service 29953","dvbs2",10817,22000,"v",0,0,"P1027:163:98","A98" +"Unknown","Service 29962","dvbs2",10817,22000,"v",0,0,"P1031:163:98","A98" +"DIGITAL+","C+ RADIOS","dvbs",10847,22000,"v",0,0,"P1076:163:400:262:257:260:256:258:259:261:268:269:263:267:265:266:264","A400:262:257:260:256:258:259:261:268:269:263:267:265:266:264" +"DIGITAL+","C+ PORTADA","dvbs",10847,22000,"v",0,0,"P1083:171:124","A124" +"Unknown","Service 30118","dvbs",10847,22000,"v",0,0,"P1093:163:400:254","A400:254" +"DIGITAL+","CANAL+ GUÍA","dvbs",10847,22000,"v",0,0,"P1096:163:400:254","A400:254" +"Digital +","Service 30122","dvbs",10847,22000,"v",0,0,"P1097:163:400:254","A400:254" +"DIGITAL+","Service 30123","dvbs",10847,22000,"v",0,0,"P1098:163:400:254","A400:254" +"Digital +","Service 30126","dvbs",10847,22000,"v",0,0,"P1029:163:400:254","A400:254" +"DIGITAL+","Service 30127","dvbs",10847,22000,"v",0,0,"P1026:163:400:254","A400:254" +"DIGITAL+","C+ TAQUILLA","dvbs",10847,22000,"v",0,0,"P1099:163:400:254","A400:254" +"DIGITAL+","BAR+","dvbs",10847,22000,"v",0,0,"P1031:163:400:254","A400:254" +"DIGITAL+","C+ TAQUILLA","dvbs",10847,22000,"v",0,0,"P1038:163:400:254","A400:254" +"DIGITAL+","C+ PORTADA","dvbs",10847,22000,"v",0,0,"P1024:171:124","A124" +"DIGITAL+","Service 30151","dvbs",10847,22000,"v",0,0,"P1025:163:400:254","A400:254" +"DIGITAL+","Service 30154","dvbs",10847,22000,"v",0,0,"P1028:163:400:254","A400:254" +"DIGITAL+","Service 30156","dvbs",10847,22000,"v",0,0,"P1030:163:400:254","A400:254" +"DIGITAL +","Service 30158","dvbs",10847,22000,"v",0,0,"P1032:163:400:254","A400:254" +"Digital +","Service 30159","dvbs",10847,22000,"v",0,0,"P1033:163:400:254","A400:254" +"DIGITAL+","CONTRATO","dvbs",10847,22000,"v",0,0,"P1043:163:400:254","A400:254" +"DIGITAL+","TEST TÉCNICO","dvbs",10847,22000,"v",0,0,"P1047","A" +"DIGITAL+","TEST_CSD1","dvbs",10847,22000,"v",0,0,"P1048:163","A" +"DIGITAL+","TEST_CSD2","dvbs",10847,22000,"v",0,0,"P1049:163:400","A400" +"DIGITAL+","TEST_CSD3","dvbs",10847,22000,"v",0,0,"P1050:163","A" +"DIGITAL+","TEST_CSD4","dvbs",10847,22000,"v",0,0,"P1051:163:400:254","A400:254" +"DIGITAL+","TEST_CSD5","dvbs",10847,22000,"v",0,0,"P1052:161:84","A84" +"DIGITAL+","Service 30179","dvbs",10847,22000,"v",0,0,"P1053:163:400:254","A400:254" +"Digital+","Service 30189","dvbs",10847,22000,"v",0,0,"P1063:163:400:254","A400:254" +"Digital +","Service 30190","dvbs",10847,22000,"v",0,0,"P1064:163:400:254","A400:254" +"DIGITAL+","Service 30191","dvbs",10847,22000,"v",0,0,"P1065:163:400:254","A400:254" +"Digital+","Service 30193","dvbs",10847,22000,"v",0,0,"P1067:163:400:254","A400:254" +"Digital+","Service 30194","dvbs",10847,22000,"v",0,0,"P1068:163:400:254","A400:254" +"Contactanos","Service 30195","dvbs",10847,22000,"v",0,0,"P1069:163:400:254","A400:254" +"Unknown","Service 30196","dvbs",10847,22000,"v",0,0,"P1070:163:400:254","A400:254" +"DIGITAL +","Service 30197","dvbs",10847,22000,"v",0,0,"P1071:163:400:254","A400:254" +"PRISA TV","GUÍA FÁCIL","dvbs",10847,22000,"v",0,0,"P1072:163:400:254","A400:254" +"Unknown","Service 30600","dvbs",10876,22000,"v",0,0,"P1024:165:100","A100" +"Unknown","Service 30604","dvbs",10876,22000,"v",0,0,"P1028:165:100","A100" +"Unknown","Service 30616","dvbs",10876,22000,"v",0,0,"P1042:171:124","A124" +"ARD","rbb Brandenburg HD","dvbs2",10891,22000,"h",0,0,"P5300:5311:5314:5312:5313:5316","A5312:5313:5316" +"ARD","rbb Berlin HD","dvbs2",10891,22000,"h",0,0,"P5310:5311:5314:5312:5313:5316","A5312:5313:5316" +"ARD","MDR Sachsen HD","dvbs2",10891,22000,"h",0,0,"P5320:5331:5334:5332:5333:5336","A5332:5333:5336" +"ARD","MDR S-Anhalt HD","dvbs2",10891,22000,"h",0,0,"P5330:5331:5334:5332:5333:5336","A5332:5333:5336" +"ARD","MDR Thüringen HD","dvbs2",10891,22000,"h",0,0,"P5340:5331:5334:5332:5333:5336","A5332:5333:5336" +"ARD","hr-fernsehen HD","dvbs2",10891,22000,"h",0,0,"P5350:5351:5354:5352:5353:5356","A5352:5353:5356" +"BetaDigital","mediaspar HD","dvbs2",10964,22000,"h",0,0,"P98:767:771","A771" +"BetaDigital","QVC BEAUTY & STYLE HD","dvbs2",10964,22000,"h",0,0,"P101:1535:37:1539","A1539" +"DIGITAL+","Service 30660","dvbs",10979,22000,"v",0,0,"P1034","A" +"SES","SES UHD Demo Channel","dvbs2",10993,22000,"h",0,0,"P256:110:120","A120" +"SES ASTRA","Astra Ultra HD Demo","dvbs2",10993,22000,"h",0,0,"P257:210:220","A220" +"ASTRA","SES","dvbs",11023,22000,"h",0,0,"P2090:2091:2092:2093","A2092:2093" +"ARD","tagesschau24 HD","dvbs2",11052,22000,"h",0,0,"P5400:5401:5404:5402:5406","A5402:5406" +"ARD","Einsfestival HD","dvbs2",11052,22000,"h",0,0,"P5410:5411:5414:5412:5413:5416","A5412:5413:5416" +"ARD","EinsPlus HD","dvbs2",11052,22000,"h",0,0,"P5420:5421:5424:5422:5423:5426","A5422:5423:5426" +"Telefonica Servicios Audiovisuales","TELESUR","dvbs",11067,22000,"v",0,0,"P35:2101:2102","A2102" +"TSA","TBN Enlace","dvbs",11067,22000,"v",0,0,"P1802:8002:8102","A8102" +"TSA","TVGA","dvbs",11067,22000,"v",0,0,"P39:1701:53:1702","A1702" +"TSA","I24 NEWS","dvbs",11067,22000,"v",0,0,"P1824:1081:1082","A1082" +"Telefonica Servicios Audiovisuales","ASTRA SEXY SAT 1","dvbs",11067,22000,"v",0,0,"P41:1901:1902","A1902" +"DIGITAL+","C+ MULTI-X","dvbs2",11097,22000,"v",0,0,"P1024:167:108:109:110","A108:109:110" +"DIGITAL+","MULTI-X","dvbs2",11097,22000,"v",0,0,"P1039:174:136:137","A136:137" +"DIGITAL+","MULTI-X","dvbs2",11097,22000,"v",0,0,"P1037:165:100:101","A100:101" +"DIGITAL+","MULTI-X","dvbs2",11097,22000,"v",0,0,"P1040:176:144:145","A144:145" +".",".","dvbs2",11111,22000,"h",0,0,"P","A" +".",".","dvbs2",11111,22000,"h",0,0,"P","A" +".",".","dvbs2",11111,22000,"h",0,0,"P","A" +".",".","dvbs2",11111,22000,"h",0,0,"P","A" +".",".","dvbs",11112,22000,"h",0,0,"P","A" +".",".","dvbs",11112,22000,"h",0,0,"P","A" +".",".","dvbs",11112,22000,"h",0,0,"P","A" +".",".","dvbs",11112,22000,"h",0,0,"P","A" +"Unknown","Service 30505","dvbs",11156,22000,"v",0,0,"P1029:166:50:104:105","A104:105" +"PRISA TV","FASHION TV","dvbs",11156,22000,"v",0,0,"P1034:165:100","A100" +"Unknown","Service 30517","dvbs",11156,22000,"v",0,0,"P1041:166:50:104:105","A104:105" +"SKY","Sky INFO","dvbs2",11170,22000,"h",0,0,"P97:511:32:515","A515" +"SKY","Sky INFO","dvbs",11171,22000,"h",0,0,"P97:511:32:515","A515" +"SES ASTRA","TV TRWAM","dvbs2",11186,21666,"v",0,0,"P8020:33:273:3606","A3606" +"SES ASTRA","BVN TV","dvbs2",11186,21666,"v",0,0,"P2116:525:40:122","A122" +"SES ASTRA","TV TRWAM","dvbs",11185,22000,"v",0,0,"P8020:33:273:3606","A3606" +"SES ASTRA","BVN TV","dvbs",11185,22000,"v",0,0,"P2116:525:40:122","A122" +"~","Volksmusik","dvbs",11243,22000,"h",0,0,"P222:2220:2221","A2221" +"ORS","Bibel TV HD","dvbs",11243,22000,"h",0,0,"P224:2240:2245:2241","A2241" +"~","Schau TV","dvbs",11243,22000,"h",0,0,"P225:2250:2255:2251","A2251" +"~","Starparadies AT","dvbs",11243,22000,"h",0,0,"P226:2260:2261","A2261" +"~","DAF Neu","dvbs",11243,22000,"h",0,0,"P227:2270:2271","A2271" +"ORS","MELODIE TV","dvbs",11243,22000,"h",0,0,"P229:2290:2291","A2291" +"ORS","Service 13230","dvbs",11243,22000,"h",0,0,"P230","A" +"ORS","Service 13231","dvbs",11243,22000,"h",0,0,"P231","A" +"ORS","Service 13232","dvbs",11243,22000,"h",0,0,"P232","A" +"ORS","Service 13233","dvbs",11243,22000,"h",0,0,"P233","A" +"ORF","flimmit","dvbs2",11273,22000,"h",0,0,"P310:3100","A" +"ORF","Aristo.TV","dvbs2",11273,22000,"h",0,0,"P311:3110:3111","A3111" +"ServusTV","ServusTV HD Oesterreich","dvbs2",11302,22000,"h",0,0,"P109:3583:3588:3584:3585:3587:3589","A3584:3585:3587:3589" +"ServusTV","ServusTV HD Deutschland","dvbs2",11302,22000,"h",0,0,"P110:4920:4925:4921:4922:4924:4926","A4921:4922:4924:4926" +"ServusTV","PVoD","dvbs2",11302,22000,"h",0,0,"P111","A" +"ZDFvision","3sat HD","dvbs2",11347,22000,"v",0,0,"P6500:6510:6530:6520:6521:6523:6522","A6520:6521:6523:6522" +"ZDFvision","KiKA HD","dvbs2",11347,22000,"v",0,0,"P6600:6610:6630:6620:6621:6622","A6620:6621:6622" +"ZDFvision","ZDFinfo HD","dvbs2",11347,22000,"v",0,0,"P6700:6710:6730:6720:6721:6723:6722","A6720:6721:6723:6722" +"ZDFvision","ZDF HD","dvbs2",11361,22000,"h",0,0,"P6100:6110:6130:6120:6121:6123:6122","A6120:6121:6123:6122" +"ZDFvision","zdf_neo HD","dvbs2",11361,22000,"h",0,0,"P6300:6310:6330:6320:6321:6323:6322","A6320:6321:6323:6322" +"ZDFvision","zdf.kultur HD","dvbs2",11361,22000,"h",0,0,"P6400:6410:6430:6420:6421:6423:6422","A6420:6421:6423:6422" +"GlobeCast","RT HD","dvbs2",11376,22000,"v",0,0,"P1010:1011:1012:1013","A1012:1013" +"GLOBECAST","RT Esp HD","dvbs2",11376,22000,"v",0,0,"P1020:1021:1022:1023","A1022:1023" +"GLOBECAST","RT Esp HD","dvbs2",11376,22000,"v",0,0,"P1120:1021:1022:1023","A1022:1023" +"BetaDigital","RTL 2 CH","dvbs",11391,22000,"h",0,0,"P96:255:32:256","A256" +"BetaDigital","Fashion Television","dvbs",11420,22000,"h",0,0,"P103:2047:2048","A2048" +"BetaDigital","SOPHIA TV","dvbs",11420,22000,"h",0,0,"P108:3327:3328","A3328" +"BetaDigital","Die Neue Zeit TV","dvbs",11420,22000,"h",0,0,"P109:3583:3584","A3584" +"BetaDigital","Club-Hot TV","dvbs",11420,22000,"h",0,0,"P117:479:3807:480","A480" +"BetaDigital","6Live 24 TV","dvbs",11420,22000,"h",0,0,"P121:1503:1504","A1504" +"BetaDigital","Reife Damen TV","dvbs",11420,22000,"h",0,0,"P122:1759:3807:1760","A1760" +"BetaDigital","Lust und Liebe TV","dvbs",11420,22000,"h",0,0,"P126:2783:2784","A2784" +"BetaDigital","Telefonchat-24 TV","dvbs",11420,22000,"h",0,0,"P130:3807:3808","A3808" +"BetaDigital","Beate Uhse Sexy-Sat","dvbs",11420,22000,"h",0,0,"P133:751:3807:752","A752" +"BetaDigital","Hot Girls TV","dvbs",11420,22000,"h",0,0,"P135:1263:3807:1264","A1264" +"BetaDigital","GayBoys LIVE","dvbs",11420,22000,"h",0,0,"P138:2031:2032","A2032" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital","SES 05","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital","SES 06","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital","SES 07","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital","SES 09","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital","SES 10","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"BetaDigital",".","dvbs",11420,22000,"h",0,0,"P","A" +"CSAT","OFFRES CANAL READY","dvbs",11479,22000,"v",0,0,"P1284:164:96","A96" +"ARD","Das Erste HD","dvbs2",11493,22000,"h",0,0,"P5100:5101:5104:5102:5103:5106","A5102:5103:5106" +"ARD","arte HD","dvbs2",11493,22000,"h",0,0,"P5110:5111:5114:5112:5113:5116:5117","A5112:5113:5116:5117" +"ARD","SWR BW HD","dvbs2",11493,22000,"h",0,0,"P5120:5121:5124:5122:5123:5126","A5122:5123:5126" +"ARD","SWR RP HD","dvbs2",11493,22000,"h",0,0,"P5130:5121:5134:5122:5123:5126","A5122:5123:5126" +"Orange TV","SSU Samsung","dvbs",11508,22000,"v",0,0,"P705","A" +"GLOBECAST","Cubavision Internacional","dvbs",11508,22000,"v",0,0,"P758:708:728","A728" +"GLOBECAST","Al Jazeera Channel","dvbs",11508,22000,"v",0,0,"P759:709:729","A729" +"GLOBECAST","RedeRecord","dvbs",11508,22000,"v",0,0,"P760:710:730","A730" +"GLOBECAST","Arirang TV","dvbs",11508,22000,"v",0,0,"P761:711:731","A731" +"GlobeCast","Al Jazeera English","dvbs",11508,22000,"v",0,0,"P762:712:732","A732" +"GlobeCast","RT Esp","dvbs",11508,22000,"v",0,0,"P1250:1450:1550","A1550" +"GLOBECAST","NHK World TV","dvbs",11508,22000,"v",0,0,"P764:714:734","A734" +"BetaDigital","a.tv","dvbs",11523,22000,"h",0,0,"P96:255:256","A256" +"BetaDigital","Franken Fernsehen","dvbs",11523,22000,"h",0,0,"P97:511:512","A512" +"BetaDigital","intv","dvbs",11523,22000,"h",0,0,"P98:767:768","A768" +"BetaDigital","Ulm-Allgäu","dvbs",11523,22000,"h",0,0,"P99:1023:1024","A1024" +"BetaDigital","münchen.tv","dvbs",11523,22000,"h",0,0,"P100:1279:1280","A1280" +"BetaDigital","rfo Regional Oberbayern","dvbs",11523,22000,"h",0,0,"P101:1535:1536","A1536" +"BetaDigital","Mainfranken","dvbs",11523,22000,"h",0,0,"P102:1791:1792","A1792" +"BetaDigital","TV Oberfranken","dvbs",11523,22000,"h",0,0,"P103:2047:2048","A2048" +"BetaDigital","TVA-OTV","dvbs",11523,22000,"h",0,0,"P104:2303:2304","A2304" +"BetaDigital","Niederbayern","dvbs",11523,22000,"h",0,0,"P105:2559:2560","A2560" +"BetaDigital","Lokal TV Portal","dvbs",11523,22000,"h",0,0,"P144:4607:4608","A4608" +"GLOBECAST","Russia Today","dvbs",11538,22000,"v",0,0,"P654:604:624","A624" +"GLOBECAST","France 24","dvbs",11538,22000,"v",0,0,"P201:605:6701:625","A625" +"GLOBECAST","France 24","dvbs",11538,22000,"v",0,0,"P202:606:6702:626","A626" +"GLOBECAST","France 24","dvbs",11538,22000,"v",0,0,"P660:610:6710:630","A630" +"GLOBECAST","CCTV9 Documentary","dvbs",11538,22000,"v",0,0,"P662:612:632","A632" +"GLOBECAST","CCTV F","dvbs",11538,22000,"v",0,0,"P663:613:633","A633" +"GLOBECAST","CCTV NEWS","dvbs",11538,22000,"v",0,0,"P664:614:634","A634" +"GlobeCast","TV5MONDE EUROPE","dvbs",11538,22000,"v",0,0,"P665:615:835:635","A635" +"ARD","BR Süd HD","dvbs2",11582,22000,"h",0,0,"P5200:5201:5204:5202:5203:5206","A5202:5203:5206" +"ARD","BR Nord HD","dvbs2",11582,22000,"h",0,0,"P5210:5201:5204:5202:5203:5206","A5202:5203:5206" +"ARD","NDR FS NDS HD","dvbs2",11582,22000,"h",0,0,"P5220:5221:5224:5222:5223:5226","A5222:5223:5226" +"ARD","NDR FS MV HD","dvbs2",11582,22000,"h",0,0,"P5230:5221:5224:5222:5223:5226","A5222:5223:5226" +"ARD","NDR FS HH HD","dvbs2",11582,22000,"h",0,0,"P5240:5221:5224:5222:5223:5226","A5222:5223:5226" +"ARD","NDR FS SH HD","dvbs2",11582,22000,"h",0,0,"P5250:5221:5224:5222:5223:5226","A5222:5223:5226" +"ARD","PHOENIX HD","dvbs2",11582,22000,"h",0,0,"P5260:5261:5264:5262:5263","A5262:5263" +"CNBC","CNBC Europe","dvbs",11597,22000,"v",0,0,"P1838:307:308","A308" +"BBC","BBC World","dvbs",11597,22000,"v",0,0,"P1858:163:92","A92" +"Groupe M6","M6 BOUTIQUE LA CHAINE","dvbs",11597,22000,"v",0,0,"P1100:1120:130","A130" +"Bloomberg TV","Bloomberg Europe TV","dvbs",11597,22000,"v",0,0,"P1090:1360:1320","A1320" +"SES ASTRA","Sonlife Broadcasting Network","dvbs",11597,22000,"v",0,0,"P1050:1051:1052:1053","A1052:1053" +"TDA","Algerie 3","dvbs",11597,22000,"v",0,0,"P256:514:670","A670" +"TDA","Canal Algerie","dvbs",11597,22000,"v",0,0,"P257:515:680","A680" +"SES ASTRA","ASTRA 3D demo","dvbs",11611,22000,"h",0,0,"P32:33:36","A36" +"SES ASTRA","TRT Turk","dvbs",11611,22000,"h",0,0,"P45:2011:2016:4004","A4004" +"Sitcom","ALICE","dvbs",11611,22000,"h",0,0,"P129:2064:2068","A2068" +"Unknown","TURKSHOW TV","dvbs",11611,22000,"h",0,0,"P1100:1101:1102","A1102" +"RTVE","TVE INTERNACIONAL EUROPA","dvbs",11626,22000,"v",0,0,"P3520:3521:3525:3522:3527","A3522:3527" +"RTVE","CANAL 24 HORAS","dvbs",11626,22000,"v",0,0,"P3568:3569:3575:3570:3571","A3570:3571" +"SES","CNN Int.","dvbs",11626,22000,"v",0,0,"P3946:165:100","A100" +"BetaDigital","TWOJ","dvbs",11641,22000,"h",0,0,"P96:255:256","A256" +"ProSiebenSat.1","SAT.1 Gold Österreich","dvbs2",11670,22000,"h",0,0,"P106:2815:42:2816","A2816" +"ProSiebenSat.1","Pro7 MAXX Austria","dvbs2",11670,22000,"h",0,0,"P107:3071:43:3072","A3072" +"ProSiebenSat.1",".","dvbs2",11670,22000,"h",0,0,"P","A" +"DIGITAL+","C+ DEP 2 HD","dvbs",11685,22000,"v",0,0,"P1026:175","A" +"PRISA TV","YOMVI","dvbs",11685,22000,"v",0,0,"P1027:163:254:92","A254:92" +"Unknown","Service 30205","dvbs",11685,22000,"v",0,0,"P1052:166:104","A104" +"Unknown","Service 30213","dvbs",11685,22000,"v",0,0,"P1032:175","A" +"PRISA TV","AXN WHITE HD","dvbs",11685,22000,"v",0,0,"P1033:175","A" +"DIGITAL+","MEZZO LIVEHD","dvbs",11685,22000,"v",0,0,"P1037:175","A" +"Unknown","Service 30216","dvbs",11685,22000,"v",0,0,"P1039:175","A" +"CANAL+","NICKELODEONHD","dvbs",11685,22000,"v",0,0,"P1050:175","A" +"DIGITAL+","C+ LIGA HD","dvbs",11685,22000,"v",0,0,"P1040:175","A" +"DIGITAL+","CANAL+1 HD","dvbs",11685,22000,"v",0,0,"P1041:175","A" +"DIGITAL+","C+ ACCIÓN HD","dvbs",11685,22000,"v",0,0,"P1042:175","A" +"DIGITAL+","C+COMEDIA HD","dvbs",11685,22000,"v",0,0,"P1043:175","A" +"DIGITAL+","C+ DCINE HD","dvbs",11685,22000,"v",0,0,"P1044:175","A" +"DIGITAL+","C+XTRA HD","dvbs",11685,22000,"v",0,0,"P1045:175","A" +"Unknown","Service 30231","dvbs",11685,22000,"v",0,0,"P1046:175","A" +"DIGITAL+","C+ FÚTBOL HD","dvbs",11685,22000,"v",0,0,"P1047:175","A" +"DIGITAL+","C+ DEPORT HD","dvbs",11685,22000,"v",0,0,"P1048:175","A" +"PRISA TV","RTESPAÑOL HD","dvbs",11685,22000,"v",0,0,"P1049:175","A" +"DIGITAL+","CALLE 13 HD","dvbs",11685,22000,"v",0,0,"P1055:175","A" +"DIGITAL+","FOX HD","dvbs",11685,22000,"v",0,0,"P1056:175","A" +"DIGITAL+","AXN HD","dvbs",11685,22000,"v",0,0,"P1057:175","A" +"DIGITAL+","NAT GEO HD","dvbs",11685,22000,"v",0,0,"P1058:175","A" +"PRISA TV","COMEDYCENTRALHD","dvbs",11685,22000,"v",0,0,"P1059:175","A" +"DIGITAL+","MEZZO LIVEHD","dvbs",11685,22000,"v",0,0,"P1060:175","A" +"DIGITAL+","CANAL+ 3D","dvbs",11685,22000,"v",0,0,"P1061:175","A" +"DIGITAL+","TAQUILLA HD","dvbs",11685,22000,"v",0,0,"P1062:175","A" +"DIGITAL+","VIAJAR HD","dvbs",11685,22000,"v",0,0,"P1063:175","A" +"DIGITAL+","COSMO HD","dvbs",11685,22000,"v",0,0,"P1064:175","A" +"DIGITAL+","HOLLYWOOD HD","dvbs",11685,22000,"v",0,0,"P1065:175","A" +"DIGITAL +","TNT HD","dvbs",11685,22000,"v",0,0,"P1066:175","A" +"DIGITAL+","NG WILD HD","dvbs",11685,22000,"v",0,0,"P1067:175","A" +"DIGITAL+","SYFY HD","dvbs",11685,22000,"v",0,0,"P1068:175","A" +"DIGITAL+","DISNEY CH HD","dvbs",11685,22000,"v",0,0,"P1069:175","A" +"PRISATV","C+LCAMPEON2","dvbs",11685,22000,"v",0,0,"P1070:175","A" +"PRISATV","C+LCAMPEONES","dvbs",11685,22000,"v",0,0,"P1071:175","A" +"PRISA TV","C+L.MULTI HD","dvbs",11685,22000,"v",0,0,"P1072:175","A" +"PRISA TV","TAQUILLA HD2","dvbs",11685,22000,"v",0,0,"P1073:175","A" +"PRISA TV","FOX LIFE HD","dvbs",11685,22000,"v",0,0,"P1074:175","A" +"PRISA TV","C+LCAMPEON3","dvbs",11685,22000,"v",0,0,"P1075:175","A" +"PRISA TV","C+ GOLF HD","dvbs",11685,22000,"v",0,0,"P1076:175","A" +"PRISA TV","CANAL+ 2 HD","dvbs",11685,22000,"v",0,0,"P1077:175","A" +"DIGITAL+","C+ XTRA HD","dvbs",11685,22000,"v",0,0,"P1078:175","A" +"Unknown","TCM HD","dvbs",11685,22000,"v",0,0,"P1079:175","A" +"PRISA TV","C+ SERIES HD","dvbs",11685,22000,"v",0,0,"P1080:175","A" +"MTV Networks Europe","VH1.","dvbs",11739,27500,"v",0,0,"P341:3061:8190:3062","A3062" +"MTV Networks Europe","VH1 Classic.","dvbs",11739,27500,"v",0,0,"P327:3071:8190:3072","A3072" +"MTV Networks Europe","Test Channel 1","dvbs",11739,27500,"v",0,0,"P","A" +"CNN","CNN Int.","dvbs",11778,27500,"v",0,0,"P3946:165:100","A100" +"ARD","Das Erste","dvbs",11836,27500,"h",0,0,"P100:101:104:102:103:106","A102:103:106" +"ARD","Bayerisches FS Süd","dvbs",11836,27500,"h",0,0,"P200:201:204:202:203:206","A202:203:206" +"ARD","hr-fernsehen","dvbs",11836,27500,"h",0,0,"P300:301:304:302:303","A302:303" +"ARD","Bayerisches FS Nord","dvbs",11836,27500,"h",0,0,"P500:201:204:202:203:206","A202:203:206" +"ARD","WDR Köln","dvbs",11836,27500,"h",0,0,"P600:601:604:602:603","A602:603" +"ARD","SWR Fernsehen BW","dvbs",11836,27500,"h",0,0,"P800:801:804:802:803:806","A802:803:806" +"CSAT","iTELE","dvbs",11856,27500,"v",0,0,"P200:210:241:221","A221" +"CSAT","iTELE","dvbs",11856,27500,"v",0,0,"P201:210:241:221","A221" +"CSAT","CANAL+ DECALE","dvbs",11895,27500,"v",0,0,"P500:510:541:521:522","A521:522" +"CSAT","Service 8361","dvbs",11895,27500,"v",0,0,"P1700","A" +"CSAT","D17","dvbs",11934,27500,"v",0,0,"P400:410:441:421:422","A421:422" +"CSAT","TV5MONDE","dvbs",11934,27500,"v",0,0,"P1000:1010:1041:1021","A1021" +"CSAT","D17","dvbs",11934,27500,"v",0,0,"P401:410:441:421:422","A421:422" +"ZDFvision","ZDF","dvbs",11953,27500,"h",0,0,"P100:110:130:120:121:122:125","A120:121:122:125" +"ZDFvision","3sat","dvbs",11953,27500,"h",0,0,"P200:210:230:220:221:222:225","A220:221:222:225" +"ZDFvision","KiKA","dvbs",11953,27500,"h",0,0,"P300:310:330:320:321:325","A320:321:325" +"ZDFvision","ZDFinfo","dvbs",11953,27500,"h",0,0,"P600:610:630:620:621:622:625","A620:621:622:625" +"ZDFvision","zdf_neo","dvbs",11953,27500,"h",0,0,"P650:660:680:670:671:672:675","A670:671:672:675" +"ZDFvision","zdf.kultur","dvbs",11953,27500,"h",0,0,"P1100:1110:1130:1120:1121:1122:1125","A1120:1121:1122:1125" +"MTV Networks Europe","Comedy Central/VIVA","dvbs",11973,27500,"v",0,0,"P416:4061:8190:4064:4062","A4062" +"MTV Networks Europe","Nickelodeon","dvbs",11973,27500,"v",0,0,"P420:4101:8190:4104:4102:4103","A4102:4103" +"MTV Networks Europe","Test Channel 2","dvbs",11973,27500,"v",0,0,"P","A" +"MTV Networks Europe","Test Channel 3","dvbs",11973,27500,"v",0,0,"P","A" +"Unknown","CANAL+ DECALE HD","dvbs2",12012,29700,"v",0,0,"P1281:161:86:87","A86:87" +"Unknown","Service 8822","dvbs2",12012,29700,"v",0,0,"P1301:161:86:87","A86:87" +"SKY","Sky Select","dvbs",12031,27500,"h",0,0,"P103:2815:2816","A2816" +"ProSiebenSat.1","ProSieben Schweiz","dvbs",12051,27500,"v",0,0,"P32:289:33:290:292","A290:292" +"ProSiebenSat.1","ProSieben Austria","dvbs",12051,27500,"v",0,0,"P1025:161:36:84:85","A84:85" +"ProSiebenSat.1","Kabel 1 Schweiz","dvbs",12051,27500,"v",0,0,"P1026:162:165:163","A163" +"ProSiebenSat.1","Kabel 1 Austria","dvbs",12051,27500,"v",0,0,"P1027:166:169:167","A167" +"ProSiebenSat.1","SAT.1 A","dvbs",12051,27500,"v",0,0,"P1028:800:802:801:803","A801:803" +"ProSiebenSat.1","SAT.1 CH","dvbs",12051,27500,"v",0,0,"P101:1535:38:1536:1539","A1536:1539" +"ProSiebenSat.1","SAT.1 HH/SH","dvbs",12051,27500,"v",0,0,"P103:2047:40:2048:2051","A2048:2051" +"ProSiebenSat.1","SAT.1 NS/Bremen","dvbs",12051,27500,"v",0,0,"P104:2047:40:2048:2051","A2048:2051" +"ProSiebenSat.1","SAT.1 RhlPf/Hessen","dvbs",12051,27500,"v",0,0,"P105:2047:40:2048:2051","A2048:2051" +"ProSiebenSat.1",".","dvbs",12051,27500,"v",0,0,"P","A" +"ARD","rbb Brandenburg","dvbs",12109,27500,"h",0,0,"P500:601:604:602:603","A602:603" +"ARD","rbb Berlin","dvbs",12109,27500,"h",0,0,"P600:601:604:602:603","A602:603" +"ARD","ARD-TEST-1","dvbs",12109,27500,"h",0,0,"P2100:601:604:602:2602","A602:2602" +"ARD","NDR FS MV","dvbs",12109,27500,"h",0,0,"P2400:2601:2604:2602:2603","A2602:2603" +"ARD","NDR FS HH","dvbs",12109,27500,"h",0,0,"P2500:2601:2604:2602:2603","A2602:2603" +"ARD","NDR FS NDS","dvbs",12109,27500,"h",0,0,"P2600:2601:2604:2602:2603","A2602:2603" +"ARD","NDR FS SH","dvbs",12109,27500,"h",0,0,"P2700:2601:2604:2602:2603","A2602:2603" +"ARD","MDR Sachsen","dvbs",12109,27500,"h",0,0,"P2800:2901:2904:2902:2903","A2902:2903" +"ARD","MDR S-Anhalt","dvbs",12109,27500,"h",0,0,"P2900:2901:2904:2902:2903","A2902:2903" +"ARD","MDR Thüringen","dvbs",12109,27500,"h",0,0,"P3000:2901:2904:2902:2903","A2902:2903" +"ARD","SWR Fernsehen RP","dvbs",12109,27500,"h",0,0,"P3100:3101:3104:3102:3103:3106","A3102:3103:3106" +"BetaDigital","N24 Austria","dvbs",12148,27500,"h",0,0,"P98:255:256","A256" +"BetaDigital","Beauty TV","dvbs",12148,27500,"h",0,0,"P100:3071:3072","A3072" +"MTV Networks","Comedy Central / VIVA AT","dvbs",12148,27500,"h",0,0,"P106:1535:33:1536","A1536" +"MTV Networks","NICKELODEON AT","dvbs",12148,27500,"h",0,0,"P107:1791:34:1792:1793","A1792:1793" +"BetaDigital","DELUXE MUSIC","dvbs",12148,27500,"h",0,0,"P99:3327:3328","A3328" +"BetaDigital","BB-MV Lokal-TV","dvbs",12148,27500,"h",0,0,"P103:2559:2560","A2560" +"BetaDigital","HOPE Channel deutsch","dvbs",12148,27500,"h",0,0,"P105:511:512","A512" +"BetaDigital","DMAX Austria","dvbs",12148,27500,"h",0,0,"P115:3583:45:3584","A3584" +"BetaDigital","JML Shop","dvbs",12148,27500,"h",0,0,"P108:2303:2304","A2304" +"BetaDigital","pearl.tv Shop","dvbs",12148,27500,"h",0,0,"P96:2047:2048","A2048" +"BetaDigital","RNF","dvbs",12148,27500,"h",0,0,"P122:1104:38:1105","A1105" +"BetaDigital","Channel21","dvbs",12148,27500,"h",0,0,"P113:1023:35:1024","A1024" +"BetaDigital","GOD Channel","dvbs",12148,27500,"h",0,0,"P97:767:768","A768" +"BetaDigital","MediaShop- Meine Einkaufswelt","dvbs",12148,27500,"h",0,0,"P114:1279:1280","A1280" +"BetaDigital",".","dvbs",12148,27500,"h",0,0,"P","A" +"RTL World","RTL Television","dvbs",12187,27500,"h",0,0,"P44:163:105:104:106","A104:106" +"RTL World","RTL Regional NRW","dvbs",12187,27500,"h",0,0,"P54:163:105:104","A104" +"RTL World","RTL HB NDS","dvbs",12187,27500,"h",0,0,"P55:163:105:104","A104" +"RTL World","RTL FS","dvbs",12187,27500,"h",0,0,"P56:163:105:104","A104" +"RTL World","RTL2","dvbs",12187,27500,"h",0,0,"P46:166:68:128","A128" +"RTL World","SUPER RTL","dvbs",12187,27500,"h",0,0,"P45:165:65:120","A120" +"RTL","SUPER RTL CH","dvbs",12187,27500,"h",0,0,"P52:172:82:145","A145" +"RTL World","VOX","dvbs",12187,27500,"h",0,0,"P47:167:71:136","A136" +"RTL","RTLNITRO","dvbs",12187,27500,"h",0,0,"P53:173:84:146","A146" +"RTL World","Channel 21","dvbs",12187,27500,"h",0,0,"P41:168:70:137","A137" +"RTL World","n-tv","dvbs",12187,27500,"h",0,0,"P48:169:80:73","A73" +"CBC","Channel 21 ALT","dvbs",12187,27500,"h",0,0,"P49:168:70:137","A137" +"RTL","RTL Austria","dvbs",12226,27500,"h",0,0,"P200:201:203:202","A202" +"RTL","VOX Austria","dvbs",12226,27500,"h",0,0,"P300:301:303:302","A302" +"RTL","RTL2 Austria","dvbs",12226,27500,"h",0,0,"P400:401:403:402","A402" +"RTL","SUPER RTL A","dvbs",12226,27500,"h",0,0,"P500:501:503:502","A502" +"SES Astra","Eurosport Deutschland","dvbs",12226,27500,"h",0,0,"P280:101:102:103","A103" +"SES Astra","HSE24 EXTRA","dvbs",12226,27500,"h",0,0,"P259:512:576:660","A660" +"Globecast","EuroNews","dvbs",12226,27500,"h",0,0,"P260:2432:2433:2434:2435:2436:2437:2438:2439:2440:2441:2442","A2433:2434:2435:2436:2437:2438:2439:2440:2441:2442" +"RTL","VOX CH","dvbs",12226,27500,"h",0,0,"P600:601:603:602","A602" +"CBC","RTL CH","dvbs",12226,27500,"h",0,0,"P610:611:614:612:613","A612:613" +"ARD","SR Fernsehen","dvbs",12265,27500,"h",0,0,"P1300:1301:1304:1302:1303","A1302:1303" +"ARD","ARD-alpha","dvbs",12265,27500,"h",0,0,"P1400:1401:1404:1402:1403:1406","A1402:1403:1406" +"CSAT","MOSAIQUE","dvbs",12324,27500,"v",0,0,"P1282:162:1906:1901:1902:1903:1904:1905:1907:1908:1909:1910:1911:1912:1913:1914:1915:1916:1917:1918:1919:1920","A1906:1901:1902:1903:1904:1905:1907:1908:1909:1910:1911:1912:1913:1914:1915:1916:1917:1918:1919:1920" +"Unknown","Service 8625","dvbs",12324,27500,"v",0,0,"P1304:162:1912","A1912" +"CSAT","MOSAIQUE","dvbs",12324,27500,"v",0,0,"P1301:162:1912","A1912" +"CSAT","MOSAIQUE","dvbs",12324,27500,"v",0,0,"P1303:162:1912","A1912" +"CSAT","MOSA 5","dvbs",12324,27500,"v",0,0,"P1289:172:1990:1981:1982:1983:1984:1985:1986:1987:1988:1989:1991:1992:1993:1994:1995:1996:1997:1998:1999:2000","A1990:1981:1982:1983:1984:1985:1986:1987:1988:1989:1991:1992:1993:1994:1995:1996:1997:1998:1999:2000" +"Unknown","Service 8615","dvbs",12324,27500,"v",0,0,"P1294:2047","A" +"CSAT","MOSA 4","dvbs",12324,27500,"v",0,0,"P1293:166:1961:1962:1963:1964:1965:1966:1967:1968:1969:1970:1971:1972:1973:1974:1975:1976:1977:1978:1979:1980","A1961:1962:1963:1964:1965:1966:1967:1968:1969:1970:1971:1972:1973:1974:1975:1976:1977:1978:1979:1980" +"CSAT","MOSA 3","dvbs",12324,27500,"v",0,0,"P1284:164:1941:1942:1943:1944:1945:1946:1947:1948:1949:1950:1951:1952:1953:1954:1955:1956:1957:1958:1959:1960","A1941:1942:1943:1944:1945:1946:1947:1948:1949:1950:1951:1952:1953:1954:1955:1956:1957:1958:1959:1960" +"CSAT","MOSA 2","dvbs",12324,27500,"v",0,0,"P1283:163:1921:1922:1923:1924:1925:1926:1927:1928:1929:1930:1931:1932:1933:1934:1935:1936:1937:1938:1939:1940","A1921:1922:1923:1924:1925:1926:1927:1928:1929:1930:1931:1932:1933:1934:1935:1936:1937:1938:1939:1940" +"CSAT","PASS PINK X","dvbs",12363,27500,"v",0,0,"P1345:2047","A" +"CSAT","CANALPLAY","dvbs",12363,27500,"v",0,0,"P1313:2047","A" +"CSAT","CAMPUS","dvbs",12363,27500,"v",0,0,"P1288:2047","A" +"CSAT","CAMPUS","dvbs",12363,27500,"v",0,0,"P1287:2047","A" +"CSAT","PASS XXL DORCEL","dvbs",12363,27500,"v",0,0,"P1342:2047","A" +"CSAT","PASS SERIES","dvbs",12363,27500,"v",0,0,"P1341:2047","A" +"CSAT","CSAT A LA DEMANDE","dvbs",12363,27500,"v",0,0,"P1308:2047","A" +"CSAT","C+ A LA DEMANDE","dvbs",12363,27500,"v",0,0,"P1285:2047","A" +"Unknown","CANALPLAY","dvbs",12363,27500,"v",0,0,"P1327:2049:2048","A2048" +"CSAT","CANALPLAY VOD","dvbs",12363,27500,"v",0,0,"P1311:2047","A" +"CSAT","6PLAY","dvbs",12363,27500,"v",0,0,"P1310:2047","A" +"CSAT","CSAT A LA DEMANDE","dvbs",12363,27500,"v",0,0,"P1303:2047","A" +"CSAT","C+ A LA DEMANDE","dvbs",12363,27500,"v",0,0,"P1284:2047","A" +"CSAT","LCP","dvbs",12402,27500,"v",0,0,"P700:710:741:721","A721" +"CSAT","ARTE","dvbs",12402,27500,"v",0,0,"P1200:1210:1241:1221:1222:1224:1223","A1221:1222:1224:1223" +"CSAT","LCP","dvbs",12402,27500,"v",0,0,"P701:710:741:721","A721" +"CSAT","ARTE","dvbs",12402,27500,"v",0,0,"P1201:1210:1241:1221:1222:1224:1223","A1221:1222:1224:1223" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4050:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4051:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4052:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4053:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4054:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4055:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4056:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4057:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4058:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4059:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4060:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4061:4910","A" +"Unknown","DECODEUR","dvbs",12402,27500,"v",0,0,"P4062:4910","A" +"Unknown","Service 8763","dvbs",12402,27500,"v",0,0,"P4063:4910","A" +"Unknown","Service 8764","dvbs",12402,27500,"v",0,0,"P4064:4910","A" +"ARD","WDR Bielefeld","dvbs",12421,27500,"h",0,0,"P300:501:504:502:503","A502:503" +"ARD","WDR Dortmund","dvbs",12421,27500,"h",0,0,"P400:501:504:502:503","A502:503" +"ARD","WDR Düsseldorf","dvbs",12421,27500,"h",0,0,"P500:501:504:502:503","A502:503" +"ARD","WDR Essen","dvbs",12421,27500,"h",0,0,"P600:501:504:502:503","A502:503" +"ARD","WDR Münster","dvbs",12421,27500,"h",0,0,"P700:501:504:502:503","A502:503" +"ARD","WDR Siegen","dvbs",12421,27500,"h",0,0,"P800:501:504:502:503","A502:503" +"ARD","WDR HD Köln","dvbs",12421,27500,"h",0,0,"P5500:5501:5504:5502:5503:5506","A5502:5503:5506" +"ARD","WDR HD Bielefeld","dvbs",12421,27500,"h",0,0,"P5510:5501:5504:5502:5503:5506","A5502:5503:5506" +"ARD","WDR HD Dortmund","dvbs",12421,27500,"h",0,0,"P5520:5501:5504:5502:5503:5506","A5502:5503:5506" +"ARD","WDR HD Düsseldorf","dvbs",12421,27500,"h",0,0,"P5530:5501:5504:5502:5503:5506","A5502:5503:5506" +"ARD","WDR HD Essen","dvbs",12421,27500,"h",0,0,"P5540:5501:5504:5502:5503:5506","A5502:5503:5506" +"ARD","WDR HD Münster","dvbs",12421,27500,"h",0,0,"P5550:5501:5504:5502:5503:5506","A5502:5503:5506" +"ARD","WDR HD Siegen","dvbs",12421,27500,"h",0,0,"P5560:5501:5504:5502:5503:5506","A5502:5503:5506" +"ARD","Radio Bremen TV","dvbs",12421,27500,"h",0,0,"P1200:1201:1204:1202","A1202" +"ARD","WDR Test A","dvbs",12421,27500,"h",0,0,"P1500:501:504:502:503","A502:503" +"BetaDigital","ManouLenz.tv","dvbs",12460,27500,"h",0,0,"P97:511:512","A512" +"BetaDigital","EWTN katholisches TV","dvbs",12460,27500,"h",0,0,"P100:1023:1024:1025","A1024:1025" +"BetaDigital","QVC BEAUTY&STYLE","dvbs",12460,27500,"h",0,0,"P102:1791:38:1792","A1792" +"BetaDigital","joiz","dvbs",12460,27500,"h",0,0,"P101:1279:1280","A1280" +"BetaDigital","Sparhandy TV","dvbs",12460,27500,"h",0,0,"P108:3071:3072","A3072" +"BetaDigital","1-2-3.tv","dvbs",12460,27500,"h",0,0,"P105:2815:32:2816","A2816" +"BetaDigital","ANIXE SD","dvbs",12460,27500,"h",0,0,"P107:3311:3312","A3312" +"BetaDigital","TLC","dvbs",12460,27500,"h",0,0,"P103:1535:37:1536","A1536" +"ProSiebenSat.1","SIXX","dvbs",12460,27500,"h",0,0,"P99:767:35:768","A768" +"BetaDigital","Disney Channel","dvbs",12460,27500,"h",0,0,"P115:2047:36:2048:2051","A2048:2051" +"BetaDigital","QVC","dvbs",12460,27500,"h",0,0,"P96:255:33:256","A256" +"BetaDigital","Sonnenklar TV","dvbs",12480,27500,"v",0,0,"P97:2303:40:2304","A2304" +"BetaDigital","HSE24","dvbs",12480,27500,"v",0,0,"P104:1279:37:1280","A1280" +"BetaDigital","mediasparTV Homeshopping","dvbs",12480,27500,"v",0,0,"P106:1791:1792","A1792" +"BetaDigital","REGIO TV","dvbs",12480,27500,"v",0,0,"P107:2047:2048","A2048" +"BetaDigital","TELE 5","dvbs",12480,27500,"v",0,0,"P99:1535:38:1536","A1536" +"BetaDigital","DMAX","dvbs",12480,27500,"v",0,0,"P108:3327:44:3328","A3328" +"BetaDigital","EBRU TV","dvbs",12480,27500,"v",0,0,"P109:2815:2816","A2816" +"BetaDigital","HSE24 TREND","dvbs",12480,27500,"v",0,0,"P110:3071:36:3072","A3072" +"BetaDigital","AstroTV","dvbs",12480,27500,"v",0,0,"P98:2559:2560","A2560" +"BetaDigital","e8 television","dvbs",12480,27500,"v",0,0,"P102:767:768","A768" +"BetaDigital","MediaShop- Neuheiten","dvbs",12480,27500,"v",0,0,"P100:255:256","A256" +"BetaDigital","meinTVshop","dvbs",12480,27500,"v",0,0,"P101:511:512","A512" +"BetaDigital","SPORT1","dvbs",12480,27500,"v",0,0,"P103:1023:39:1024","A1024" +"M7 Group","CD/TVV info&nieuws","dvbs",12515,22000,"h",0,0,"P2116:525:8190:120","A120" +"Unknown","Service 9298","dvbs",12522,22000,"v",0,0,"P1340:1010","A" +"Unknown","Service 9205","dvbs",12522,22000,"v",0,0,"P1284:164:96","A96" +"ProSiebenSat.1","SAT.1","dvbs",12544,22000,"h",0,0,"P96:255:32:256:259","A256:259" +"ProSiebenSat.1","ProSieben","dvbs",12544,22000,"h",0,0,"P97:511:33:512:515","A512:515" +"ProSiebenSat.1","kabel eins","dvbs",12544,22000,"h",0,0,"P98:767:34:768","A768" +"ProSiebenSat.1","N24","dvbs",12544,22000,"h",0,0,"P99:1023:35:1024","A1024" +"ProSiebenSat.1","SAT.1 Gold","dvbs",12544,22000,"h",0,0,"P100:1279:36:1280","A1280" +"ProSiebenSat.1","ProSieben MAXX","dvbs",12544,22000,"h",0,0,"P101:1535:37:1536","A1536" +"ProSiebenSat.1","SAT.1 Bayern","dvbs",12544,22000,"h",0,0,"P103:255:32:256:259","A256:259" +"ProSiebenSat.1","SAT.1 NRW","dvbs",12544,22000,"h",0,0,"P104:255:32:256:259","A256:259" +"SES ASTRA","QVC PLUS","dvbs",12551,22000,"v",0,0,"P1060:168:146:144","A144" +"SES ASTRA","QVC Deutschland","dvbs",12551,22000,"v",0,0,"P1030:165:167:166","A166" +"SES ASTRA","Bibel TV","dvbs",12551,22000,"v",0,0,"P32:33:36:34","A34" +"SES ASTRA","eUrotic","dvbs",12551,22000,"v",0,0,"P47:460:470","A470" +"SES ASTRA","BFM TV","dvbs",12551,22000,"v",0,0,"P2170:2171:345:2172","A2172" +"SES ASTRA","BFM TV","dvbs",12551,22000,"v",0,0,"P2170:2171:345:2172","A2172" +"SES ASTRA","BFM Business","dvbs",12551,22000,"v",0,0,"P1059:39:38","A38" +"SES ASTRA","CashTV","dvbs",12551,22000,"v",0,0,"P1070:1071:1072","A1072" +"SES ASTRA","8 MONT-BLANC","dvbs",12551,22000,"v",0,0,"P","A" +"BetaDigital","sonnenklar.TV HD","dvbs2",12574,22000,"h",0,0,"P96:255:32:259","A259" +"BetaDigital","Juwelo HD","dvbs2",12574,22000,"h",0,0,"P99:1023:1024","A1024" +"BetaDigital","pearl.tv HD Shop","dvbs2",12574,22000,"h",0,0,"P100:1279:1280","A1280" +"BetaDigital","TecTime TV","dvbs2",12574,22000,"h",0,0,"P107:3071:3072","A3072" +"CSAT","A LA DEMANDE","dvbs",12581,22000,"v",0,0,"P1283:163:92","A92" +"SES ASTRA","STB Comag","dvbs",12603,22000,"h",0,0,"P7266","A" +"SES ASTRA","Sky News Intl","dvbs",12603,22000,"h",0,0,"P7290:1290:2290","A2290" +"ARD","WDR Aachen","dvbs",12603,22000,"h",0,0,"P3400:3401:3804:3402:3403","A3402:3403" +"ARD","WDR Wuppertal","dvbs",12603,22000,"h",0,0,"P3500:3401:3804:3402:3403","A3402:3403" +"ARD","WDR Bonn","dvbs",12603,22000,"h",0,0,"P3600:3401:3804:3402:3403","A3402:3403" +"ARD","WDR Duisburg","dvbs",12603,22000,"h",0,0,"P3700:3401:3804:3402:3403","A3402:3403" +"ARD","WDR HD Aachen","dvbs",12603,22000,"h",0,0,"P5600:5601:5604:5602:5603:5606","A5602:5603:5606" +"ARD","WDR HD Wuppertal","dvbs",12603,22000,"h",0,0,"P5610:5601:5604:5602:5603:5606","A5602:5603:5606" +"ARD","WDR HD Bonn","dvbs",12603,22000,"h",0,0,"P5620:5601:5604:5602:5603:5606","A5602:5603:5606" +"ARD","WDR HD Duisburg","dvbs",12603,22000,"h",0,0,"P5630:5601:5604:5602:5603:5606","A5602:5603:5606" +"MEDIA BROADCAST","MEDIA BROADCAST - Test 7","dvbs",12633,22000,"h",0,0,"P100:1113:1114","A1114" +"MEDIA BROADCAST","K-TV","dvbs",12633,22000,"h",0,0,"P102:202:502:302","A302" +"MEDIA BROADCAST","Deutsches Musik Fernsehen","dvbs",12633,22000,"h",0,0,"P105:53:504:54","A54" +"MEDIA BROADCAST","Lustkanal24 TV","dvbs",12633,22000,"h",0,0,"P106:206:306","A306" +"MEDIA BROADCAST","MEDIA BROADCAST - Test 6","dvbs",12633,22000,"h",0,0,"P107:1113:1114","A1114" +"MEDIA BROADCAST","Sexy Club TV","dvbs",12633,22000,"h",0,0,"P112:212:206:312","A312" +"MEDIA BROADCAST","rhein main tv","dvbs",12633,22000,"h",0,0,"P108:208:508:308","A308" +"MEDIA BROADCAST","Deutsche Girls 24 TV","dvbs",12633,22000,"h",0,0,"P115:215:206:315","A315" +"MEDIA BROADCAST","Juwelo TV","dvbs",12633,22000,"h",0,0,"P116:1041:1042","A1042" +"MEDIA BROADCAST","Dreamgirls24 TV","dvbs",12633,22000,"h",0,0,"P118:218:206:318","A318" +"MEDIA BROADCAST","Erotiksat24 TV","dvbs",12633,22000,"h",0,0,"P119:219:206:319","A319" +"MEDIA BROADCAST","123-Damenwahl","dvbs",12633,22000,"h",0,0,"P120:220:206:320","A320" +"MEDIA BROADCAST","MEDIA BROADCAST - Test 5","dvbs",12633,22000,"h",0,0,"P121:1113:1114","A1114" +"MEDIA BROADCAST","Maennersache TV","dvbs",12633,22000,"h",0,0,"P122:222:322","A322" +"MEDIA BROADCAST","Date Line","dvbs",12633,22000,"h",0,0,"P123:223:323","A323" +"MEDIA BROADCAST","Fotohandy","dvbs",12633,22000,"h",0,0,"P124:224:324","A324" +"MEDIA BROADCAST","Mobile Sex","dvbs",12633,22000,"h",0,0,"P125:225:325","A325" +"MEDIA BROADCAST","SEX-Kontakte","dvbs",12633,22000,"h",0,0,"P126:226:326","A326" +"MEDIA BROADCAST","Eros TV","dvbs",12633,22000,"h",0,0,"P127:227:206:327","A327" +"MEDIA BROADCAST","Achtung Sexy TV","dvbs",12633,22000,"h",0,0,"P128:228:206:328","A328" +"MEDIA BROADCAST","Traumfrauen TV","dvbs",12633,22000,"h",0,0,"P129:229:206:329","A329" +"MEDIA BROADCAST","Heiss und Sexy TV","dvbs",12633,22000,"h",0,0,"P130:230:206:330","A330" +"MEDIA BROADCAST","Shop24Direct","dvbs",12633,22000,"h",0,0,"P133:233:333","A333" +"MEDIA BROADCAST","nice","dvbs",12633,22000,"h",0,0,"P134:242:342","A342" +"MEDIA BROADCAST","Babestation24","dvbs",12633,22000,"h",0,0,"P135:235:335","A335" +"MEDIA BROADCAST","Fundorado TV","dvbs",12633,22000,"h",0,0,"P136:236:336","A336" +"MEDIA BROADCAST","EROTIKA TV - NEU!","dvbs",12633,22000,"h",0,0,"P139:239:339","A339" +"MEDIA BROADCAST","BunnyClub24","dvbs",12633,22000,"h",0,0,"P140:240:340","A340" +"MEDIA BROADCAST","Clipmobile","dvbs",12633,22000,"h",0,0,"P141:241:341","A341" +"MEDIA BROADCAST","MEDIA BROADCAST - Test 4","dvbs",12633,22000,"h",0,0,"P142:1113:1114","A1114" +"MEDIA BROADCAST","ALT - SUCHLAUF STARTEN","dvbs",12633,22000,"h",0,0,"P143:53:504:54","A54" +"MEDIA BROADCAST","multithek","dvbs",12633,22000,"h",0,0,"P144:244","A" +"MEDIA BROADCAST","MEDIA BROADCAST - Test 3","dvbs",12633,22000,"h",0,0,"P156:1113:1114","A1114" +"MEDIA BROADCAST","MEDIA BROADCAST - Test 2","dvbs",12633,22000,"h",0,0,"P157:1113:1114","A1114" +"MEDIA BROADCAST","MEDIA BROADCAST - Test 1","dvbs",12633,22000,"h",0,0,"P164:1113:1114","A1114" +"RTL","RTL NITRO A","dvbs",12662,22000,"h",0,0,"P1102:1020:1025:1021","A1021" +"~","Welt der Wunder","dvbs",12662,22000,"h",0,0,"P1103:1030:1031","A1031" +"~","LT1-OOE","dvbs",12662,22000,"h",0,0,"P1104:1040:1041","A1041" +"sevenonemedia","sixx Austria","dvbs",12662,22000,"h",0,0,"P1106:1060:1063:1061","A1061" +"~","VISIT-X.tv","dvbs",12662,22000,"h",0,0,"P1107:1070:1071","A1071" +"ServusTV","ServusTV Deutschland","dvbs",12662,22000,"h",0,0,"P1210:1110:1115:1111:1112","A1111:1112" +"ServusTV","ServusTV Oesterreich","dvbs",12662,22000,"h",0,0,"P1211:2110:2115:2111:2112","A2111:2112" +"~","L-TV/TVM","dvbs",12662,22000,"h",0,0,"P1213:2130:2131","A2131" +"~","BTV","dvbs",12662,22000,"h",0,0,"P1241:2410:2411","A2411" +"CSAT","MULTISPORTS","dvbs2",12669,22000,"v",0,0,"P1800","A" +"ORF","HITRADIO OE3","dvbs",12692,22000,"h",0,0,"P1003:130:131","A131" +"ORF","ORF2E","dvbs",12692,22000,"h",0,0,"P1004:170:505:171","A171" +"~","Service 13015","dvbs",12692,22000,"h",0,0,"P1005:150","A" +"~","Service 13016","dvbs",12692,22000,"h",0,0,"P1006:150","A" +"~","Service 13017","dvbs",12692,22000,"h",0,0,"P1007:150","A" +"~","Folx TV","dvbs",12692,22000,"h",0,0,"P1008:180:181","A181" +"~","RiC","dvbs",12692,22000,"h",0,0,"P1009:190:191","A191" +"GoTV","gotv","dvbs",12692,22000,"h",0,0,"P1021:3020:3021","A3021" diff --git a/octoserve/var/channels/e13e.csv b/octoserve/var/channels/e13e.csv new file mode 100644 index 0000000..54d828f --- /dev/null +++ b/octoserve/var/channels/e13e.csv @@ -0,0 +1,533 @@ +CATEGORY,TITLE,SYSTEM,FREQ,SR,POL,RADIO,ENC,PIDS,TRACKS +"Unknown","Service 4410","dvbs",10719,27500,"v",0,0,"P1010:169:108","A108" +"CYFRA +","4fun.TV","dvbs",10719,27500,"v",0,0,"P1004:163:516:92","A92" +"Arqiva","Islam TV","dvbs",10723,29900,"h",0,0,"P101:1001:1201","A1201" +"Arqiva","Truth TV","dvbs",10723,29900,"h",0,0,"P102:1002:1202","A1202" +"Arqiva","RTPi","dvbs",10723,29900,"h",0,0,"P103:1003:1103:1203","A1203" +"Arqiva","MTA INTL","dvbs",10723,29900,"h",0,0,"P104:1004:1104:1204:1304:1404:1504:1604:1704","A1104:1204:1304:1404:1504:1604:1704" +"Arqiva","Zagros","dvbs",10723,29900,"h",0,0,"P170:1070:1270:1370","A1270:1370" +"Arqiva","RTB Virgilio","dvbs",10723,29900,"h",0,0,"P173:1073:1273","A1273" +"Arqiva","Ariana Afghanistan","dvbs",10723,29900,"h",0,0,"P174:1074:1274","A1274" +"Arqiva","Andisheh TV","dvbs",10723,29900,"h",0,0,"P175:1075:1275","A1275" +"Arqiva","Hope Channel","dvbs",10723,29900,"h",0,0,"P177:1077:1277","A1277" +"Arqiva","IPN TV","dvbs",10723,29900,"h",0,0,"P178:1078:1278","A1278" +"Arqiva","ESTV","dvbs",10723,29900,"h",0,0,"P179:1079:1279","A1279" +"Cyfrowy Polsat S.A.","xxxVOD1","dvbs",10758,27500,"v",0,0,"P32","A" +"Cyfrowy Polsat S.A.","xxxVOD2","dvbs",10758,27500,"v",0,0,"P32","A" +"SkyItalia","Real Time +1","dvbs",10775,29900,"h",0,0,"P271:2516:2517:2518","A2517:2518" +"CYFRA +","POLONIA1","dvbs",10796,27500,"v",0,0,"P1006:165:100","A100" +"CYFRA +","TELE5","dvbs",10796,27500,"v",0,0,"P1005:164:96","A96" +"RRSat","BVN","dvbs",10815,27500,"h",0,0,"P1011:2011:3011","A3011" +"RRSat","Rojhelat","dvbs",10815,27500,"h",0,0,"P1022:2022:3022","A3022" +"RRSat","KURDsat","dvbs",10815,27500,"h",0,0,"P1018:2018:3018:4018","A3018:4018" +"RRSat","HCTV","dvbs",10815,27500,"h",0,0,"P1070:2070:3070","A3070" +"RRSat","Somalisat","dvbs",10815,27500,"h",0,0,"P1072:2072:3072","A3072" +"RRSat","CNL","dvbs",10815,27500,"h",0,0,"P1012:2012:3012","A3012" +"RRSat","MKTV sat","dvbs",10815,27500,"h",0,0,"P1019:2019:3019","A3019" +"RRSat","Nasch TV","dvbs",10815,27500,"h",0,0,"P1014:2014:3014","A3014" +"RRSat","Soyuz TV","dvbs",10815,27500,"h",0,0,"P1013:2013:3013","A3013" +"RRSat","Vozrojdenie.tv","dvbs",10815,27500,"h",0,0,"P1008:2008:3008","A3008" +"RRSat","Fashion TV","dvbs",10815,27500,"h",0,0,"P1015:2015:3015:4015","A3015:4015" +"RRSat","VTV4","dvbs",10815,27500,"h",0,0,"P1021:2021:3021","A3021" +"RRSat","Thai Global Network","dvbs",10815,27500,"h",0,0,"P1020:2020:3020","A3020" +"RRSat","3ABN International","dvbs",10815,27500,"h",0,0,"P1010:2010:3010","A3010" +"RRSat","The Word Network","dvbs",10815,27500,"h",0,0,"P1073:2073:3073","A3073" +"RRSat","Kanal Hayat","dvbs",10815,27500,"h",0,0,"P1076:2076:3076","A3076" +"RRSat","Armenia TV","dvbs",10815,27500,"h",0,0,"P1075:2075:3075","A3075" +"RRSat","TVK","dvbs",10815,27500,"h",0,0,"P1037:2037:3037","A3037" +"SkyItalia","Nuvolari","dvbs",10853,29900,"h",0,0,"P278:3116:3012:3117","A3117" +"SNRT","Al Aoula Inter","dvbs",10873,27500,"v",0,0,"P1024:1026:1027","A1027" +"SNRT","Al Aoula Inter+L","dvbs",10873,27500,"v",0,0,"P33:35:36","A36" +"SNRT","Arriadia","dvbs",10873,27500,"v",0,0,"P2560:2562:2563","A2563" +"SNRT","Arrabiaa","dvbs",10873,27500,"v",0,0,"P44:46:47","A47" +"SNRT","Al Maghribia","dvbs",10873,27500,"v",0,0,"P306:308:309","A309" +"SNRT","Assadissa","dvbs",10873,27500,"v",0,0,"P1536:1537:1538","A1538" +"SNRT","Tamazight","dvbs",10873,27500,"v",0,0,"P3840:3841:3842:3843","A3842:3843" +"Medi1","Medi1TV","dvbs",10873,27500,"v",0,0,"P2048:2050:2049","A2049" +"Cyfrowy Polsat S.A.","STARS.TV","dvbs",10911,27500,"v",0,0,"P32:259:515","A515" +"Cyfrowy Polsat S.A.","TVR HD","dvbs",10911,27500,"v",0,0,"P32:262:518","A518" +"Eutelsat","Eutelsat","dvbs",10911,27500,"v",0,0,"P32","A" +"Cyfrowy Polsat S.A.","TVR HD","dvbs",10911,27500,"v",0,0,"P32:262:518","A518" +"Globecast UK","Noursat","dvbs",10949,27500,"v",0,0,"P5198:5101:5111","A5111" +"Globecast UK","Al Hiwar","dvbs",10949,27500,"v",0,0,"P266:6501:6511","A6511" +"Globecast UK","DMC TV","dvbs",10949,27500,"v",0,0,"P264:6801:6811:6812:6813:6814","A6811:6812:6813:6814" +"Globecast UK","Miracle TV","dvbs",10949,27500,"v",0,0,"P6998:6901:6911","A6911" +"Globecast UK","iLike TV","dvbs",10949,27500,"v",0,0,"P7198:7101:111","A111" +"Globecast UK","Al Forat","dvbs",10949,27500,"v",0,0,"P268:7201:7211","A7211" +"Globecast UK","Al Fady","dvbs",10949,27500,"v",0,0,"P7398:7301:7311","A7311" +"Globecast UK","Sat 7 Pars","dvbs",10949,27500,"v",0,0,"P7898:7801:7811","A7811" +"Globecast UK","Velayat TV","dvbs",10949,27500,"v",0,0,"P7998:7901:7911","A7911" +"Globecast UK","Karbala Satellite Channel","dvbs",10949,27500,"v",0,0,"P6398:6301:6311:6312","A6311:6312" +"Globecast UK","Al Maaref","dvbs",10949,27500,"v",0,0,"P6698:6601:6611","A6611" +"Globecast UK","Ahl E Bait","dvbs",10949,27500,"v",0,0,"P6298:6201:6211","A6211" +"RAI","Rai 1","dvbs",10992,27500,"v",0,0,"P1104:512:576:650:694","A650:694" +"RAI","Rai 2","dvbs",10992,27500,"v",0,0,"P1105:513:577:651:695:696","A651:695:696" +"RAI","Rai 3","dvbs",10992,27500,"v",0,0,"P1106:514:578:652:697","A652:697" +"RAI","Rai News","dvbs",10992,27500,"v",0,0,"P1107:520:690","A690" +"Telespazio","Test_Enc 01","dvbs",11013,27500,"h",0,0,"P100:101:102","A102" +"Telespazio","Test_Enc 02","dvbs",11013,27500,"h",0,0,"P110:111:112","A112" +"Telespazio","Test_Enc 03","dvbs",11013,27500,"h",0,0,"P120:121:122","A122" +"Telespazio","Test_Enc 04","dvbs",11013,27500,"h",0,0,"P130:131:132","A132" +"GlobeCast","TV CORAN","dvbs",11034,27500,"v",0,0,"P100:120:130","A130" +"GlobeCast","TV TAMAZIGHT","dvbs",11034,27500,"v",0,0,"P200:220:230","A230" +"GlobeCast","Jewish News One","dvbs",11034,27500,"v",0,0,"P300:320:330:331:332:333:335:334:336:337","A330:331:332:333:335:334:336:337" +"GlobeCast","Shanson TV","dvbs",11034,27500,"v",0,0,"P400:420:430","A430" +"GlobeCast","2M Maroc","dvbs",11034,27500,"v",0,0,"P500:520:530","A530" +"GlobeCast","CCTV-News","dvbs",11034,27500,"v",0,0,"P600:620:630","A630" +"GlobeCast","Ganj E Hozour","dvbs",11034,27500,"v",0,0,"P1700:1720:1730","A1730" +"GlobeCast","RTR","dvbs",11034,27500,"v",0,0,"P800:820:830","A830" +"GlobeCast","Rossiya 24","dvbs",11034,27500,"v",0,0,"P1000:1020:1030","A1030" +"GlobeCast","TRT Turk","dvbs",11034,27500,"v",0,0,"P1200:1220:1240:1230","A1230" +"GlobeCast","Al Jazeera Intl","dvbs",11034,27500,"v",0,0,"P1400:1420:1430","A1430" +"GlobeCast","SHANT TV","dvbs",11034,27500,"v",0,0,"P700:720:710:730","A730" +"MEDIA BROADCAST","RTL 2 CH","dvbs",11054,27500,"h",0,0,"P400:410:440:420","A420" +"MEDIA BROADCAST","ZDF","dvbs",11054,27500,"h",0,0,"P1033:570:572:571","A571" +"MEDIA BROADCAST","nex1","dvbs",11054,27500,"h",0,0,"P2000:2010:2020","A2020" +"MEDIA BROADCAST","Persian Star 2","dvbs",11054,27500,"h",0,0,"P2100:2110:2120","A2120" +"MEDIA BROADCAST","MI-TV","dvbs",11054,27500,"h",0,0,"P56:57:58","A58" +"MEDIA BROADCAST","Al Beladi TV","dvbs",11054,27500,"h",0,0,"P2700:2710:2720","A2720" +"MEDIA BROADCAST","IRAN-FMTV","dvbs",11054,27500,"h",0,0,"P3000:3010:3020","A3020" +"MEDIA BROADCAST","MB SmartCast Test 2","dvbs",11054,27500,"h",0,0,"P3100:3110:3120","A3120" +"MEDIA BROADCAST","TMTV","dvbs",11054,27500,"h",0,0,"P3200:3210:3220","A3220" +"MEDIA BROADCAST","IRAN-MNTV","dvbs",11054,27500,"h",0,0,"P3500:3510:3520","A3520" +"MEDIA BROADCAST","Iran Music","dvbs",11054,27500,"h",0,0,"P3600:3610:3620","A3620" +"MEDIA BROADCAST","MB SmartCast Test 1","dvbs",11054,27500,"h",0,0,"P3900:3910:3920","A3920" +"MEDIA BROADCAST","4","dvbs",11054,27500,"h",0,0,"P4400:4410:4420","A4420" +"MEDIA BROADCAST","Persian Star 1","dvbs",11054,27500,"h",0,0,"P4900:4910:4920","A4920" +"Globecast UK","R1","dvbs",11117,27500,"v",0,0,"P6698:6601:6611","A6611" +"GlobeCast UK","Loveworld","dvbs",11117,27500,"v",0,0,"P6598:6501:6511","A6511" +"GlobeCast UK","CNBC PE Hot","dvbs",11117,27500,"v",0,0,"P6998:6901:6999:6911","A6911" +"Arqiva","Bloomberg European TV","dvbs",11137,27500,"h",0,0,"P265:3502:3582:3622","A3622" +"Arqiva","ITN","dvbs",11137,27500,"h",0,0,"P263:3503:3623","A3623" +"Arqiva","TV5MONDE FBS","dvbs",11137,27500,"h",0,0,"P717:3521:3601:3641","A3641" +"Arqiva","TV5MONDE EUROPE","dvbs",11137,27500,"h",0,0,"P719:3522:3602:3642","A3642" +"Arqiva","Kurdistan TV","dvbs",11137,27500,"h",0,0,"P258:3526:3646","A3646" +"Arqiva","NHK World","dvbs",11137,27500,"h",0,0,"P259:3527:3647","A3647" +"Arqiva","GEM TV","dvbs",11137,27500,"h",0,0,"P33:3533:3653","A3653" +"Arqiva","AB Channel","dvbs",11137,27500,"h",0,0,"P274:3534:3614:3654","A3654" +"Arqiva","SRI TV","dvbs",11137,27500,"h",0,0,"P275:3535:3655","A3655" +"Arqiva","Fadak TV","dvbs",11137,27500,"h",0,0,"P281:3541:3661","A3661" +"Arqiva","Wesal TV","dvbs",11137,27500,"h",0,0,"P282:3542:3662","A3662" +"Ariva","Gioielli per Tutti","dvbs",11137,27500,"h",0,0,"P283:3543:3663","A3663" +"Arqiva","IRAN B MARZ","dvbs",11137,27500,"h",0,0,"P285:3545:3665","A3665" +"Telespazio","Al Malakoot","dvbs",11179,27500,"h",0,0,"P1051:161:162","A162" +"Telespazio","Al Karma TV-ME","dvbs",11179,27500,"h",0,0,"P1052:640:625","A625" +"Harmonic","Channel One Tv","dvbs",11179,27500,"h",0,0,"P165:166:167","A167" +"Telespazio","TELEPADREPIO","dvbs",11179,27500,"h",0,0,"P1070:650:651","A651" +"Telespazio","Informazione TV","dvbs",11179,27500,"h",0,0,"P1015:620:621","A621" +"Telespazio","Made in Italy 1","dvbs",11179,27500,"h",0,0,"P1016:1490:1491","A1491" +"Telespazio","GBR","dvbs",11179,27500,"h",0,0,"P1049:710:711","A711" +"Telespazio","CTV AP","dvbs",11179,27500,"h",0,0,"P1551:554:564","A564" +"Telespazio","STERK TV","dvbs",11179,27500,"h",0,0,"P1724:821:822","A822" +"Telespazio","TRSP","dvbs",11179,27500,"h",0,0,"P1053:630:631","A631" +"Telespazio","Telemarket","dvbs",11179,27500,"h",0,0,"P1055:770:771","A771" +"Telespazio","ERDE UND MENSCH","dvbs",11179,27500,"h",0,0,"P1056:780:781","A781" +"Harmonic","Made in Italy","dvbs",11179,27500,"h",0,0,"P1057:1490:1491","A1491" +"Telespazio","Kanal Hayat","dvbs",11179,27500,"h",0,0,"P1089:530:531","A531" +"Telespazio","Payam-E-Afghan","dvbs",11179,27500,"h",0,0,"P1081:540:541","A541" +"Harmonic","RTA","dvbs",11179,27500,"h",0,0,"P1083:560:561","A561" +"Telespazio","Armenia TV","dvbs",11179,27500,"h",0,0,"P1084:570:571","A571" +"Telespazio","ACM Channel","dvbs",11179,27500,"h",0,0,"P1085:340:341","A341" +"Telespazio","Marjaeyat","dvbs",11179,27500,"h",0,0,"P1063:580:581","A581" +"Telespazio","Kentron Tv","dvbs",11179,27500,"h",0,0,"P1065:2018:3018","A3018" +"Telespazio","Khatereh","dvbs",11179,27500,"h",0,0,"P1041:512:612","A612" +"Telespazio","Ronahi TV","dvbs",11179,27500,"h",0,0,"P1725:725:726","A726" +"Telespazio","Daring tv! 133","dvbs",11179,27500,"h",0,0,"P1761","A" +"RRSat","Pro TV International","dvbs",11200,27500,"v",0,0,"P1001:2001:3001","A3001" +"RRSat","AL FAYHAA","dvbs",11200,27500,"v",0,0,"P270:271:272","A272" +"RRSat","Mohabat","dvbs",11200,27500,"v",0,0,"P372:370:371","A371" +"RRSat","CGN","dvbs",11200,27500,"v",0,0,"P1004:2004:3004","A3004" +"RRSat","Gali Kurdistan TV","dvbs",11200,27500,"v",0,0,"P1005:2005:3005:4005","A3005:4005" +"RRSat","MTA International","dvbs",11200,27500,"v",0,0,"P2560:366:367","A367" +"RRSat","Dieu TV","dvbs",11200,27500,"v",0,0,"P542:540:541","A541" +"RRSat","CBC TV","dvbs",11200,27500,"v",0,0,"P1008:2008:3008","A3008" +"RRSat","AZTV","dvbs",11200,27500,"v",0,0,"P1009:2009:3009","A3009" +"RRSat","SonLife Broadcasting Network","dvbs",11200,27500,"v",0,0,"P1015:2015:3015","A3015" +"RRSat","Eurotic TV","dvbs",11200,27500,"v",0,0,"P411:412:413","A413" +"RRSat","Belarus TV","dvbs",11200,27500,"v",0,0,"P1022:2022:3022","A3022" +"RRSat","Movie1","dvbs",11200,27500,"v",0,0,"P1026:2026:3026","A3026" +"RRSat","Altarek - The Way TV","dvbs",11200,27500,"v",0,0,"P1050:2050:3050","A3050" +"RRsat","Somaliland National TV","dvbs",11200,27500,"v",0,0,"P1055:2055:3055","A3055" +"RRSat","Suryoyo Sat","dvbs",11200,27500,"v",0,0,"P1060:2060:3060","A3060" +"RRSat","GUNAZ TV","dvbs",11200,27500,"v",0,0,"P1063:2063:3063","A3063" +"RRSat","Rainbow","dvbs",11200,27500,"v",0,0,"P1066:2066:3066","A3066" +"RRSat","negah e shoma","dvbs",11200,27500,"v",0,0,"P1067:2067:3067","A3067" +"RRSat","PNTV","dvbs",11200,27500,"v",0,0,"P1068:2068:3068","A3068" +"RRSat","World Fashion Channel","dvbs",11200,27500,"v",0,0,"P1069:2069:3069","A3069" +"TandbergTV","Cancao Nova","dvbs",11240,27500,"v",0,0,"P1050:720:721","A721" +"Eutelsat","France 24","dvbs",11240,27500,"v",0,0,"P244:245:246","A246" +"Eutelsat","France 24","dvbs",11240,27500,"v",0,0,"P247:248:249","A249" +"Eutelsat","A3","dvbs",11240,27500,"v",0,0,"P3940:3941:3942","A3942" +"Unknown","Canal Algerie","dvbs",11240,27500,"v",0,0,"P3950:3951:3952","A3952" +"Al Jazeera","JSC Sports Global","dvbs",11296,27500,"h",0,0,"P252:6302:6303:6305","A6303:6305" +"Arqiva","T.TV","dvbs",11317,27500,"v",0,0,"P124:1024:1224","A1224" +"Arqiva","Marjaeyat","dvbs",11317,27500,"v",0,0,"P125:1025:1225","A1225" +"Arqiva","AVA MOVIE","dvbs",11317,27500,"v",0,0,"P126:1026:1226","A1226" +"Arqiva","Rudaw","dvbs",11317,27500,"v",0,0,"P127:1027:1227:1327","A1227:1327" +"Arqiva","Russia Today","dvbs",11317,27500,"v",0,0,"P129:1029:1229","A1229" +"Arqiva","Imam Hussein 3","dvbs",11317,27500,"v",0,0,"P130:1030:1230","A1230" +"Arqiva","Russia Al-Yaum","dvbs",11317,27500,"v",0,0,"P132:1032:1232","A1232" +"Arqiva","Perspolis TV","dvbs",11317,27500,"v",0,0,"P33:1033:1233","A1233" +"Arqiva","Ghasedak TV","dvbs",11317,27500,"v",0,0,"P135:1035:1235","A1235" +"Arqiva","Tik TV","dvbs",11317,27500,"v",0,0,"P136:1036:1236","A1236" +"Unknown","Imam Hussein TV","dvbs",11317,27500,"v",0,0,"P137:1037:1237","A1237" +"Arqiva","Baqi TV","dvbs",11317,27500,"v",0,0,"P138:1038:1238","A1238" +"Arqiva","Al-Hayat","dvbs",11317,27500,"v",0,0,"P139:1039:1239","A1239" +"Arqiva","Manoto 1","dvbs",11317,27500,"v",0,0,"P150:1050:1250","A1250" +"Harmonic","Pars TV","dvbs",11317,27500,"v",0,0,"P160:1060:1260","A1260" +"Arqiva","Elite Shopping","dvbs",11317,27500,"v",0,0,"P170:1070:1270","A1270" +"Arqiva","Liguria TV","dvbs",11317,27500,"v",0,0,"P171:1071:1271","A1271" +"Arqiva","ASO SAT","dvbs",11317,27500,"v",0,0,"P172:1072:1272","A1272" +"Arqiva","Dance TV","dvbs",11317,27500,"v",0,0,"P173:1073:1273","A1273" +"Arqiva","Roma Sat","dvbs",11317,27500,"v",0,0,"P174:1073:1273","A1273" +"Arqiva","Mondo Shop","dvbs",11317,27500,"v",0,0,"P175:1073:1273","A1273" +"Arqiva","Mare TV","dvbs",11317,27500,"v",0,0,"P176:1073:1273","A1273" +"Arqiva","Dipre Art Channel","dvbs",11317,27500,"v",0,0,"P177:1073:1273","A1273" +"Arqiva","Il Sole","dvbs",11317,27500,"v",0,0,"P191","A" +"ARQIVA","Service-1 HD","dvbs",11334,27500,"h",0,0,"P301:1001:1002","A1002" +"TVN","Eska TV","dvbs",11393,27500,"v",0,0,"P264:516:690","A690" +"TVN","Mango 24","dvbs",11393,27500,"v",0,0,"P265:517:581:700","A700" +"ITI","MANGO 24_","dvbs",11393,27500,"v",0,0,"P288:517:581:700","A700" +"TVN","Upload","dvbs",11393,27500,"v",0,0,"P257","A" +"Satlink","VENETO LINK","dvbs",11471,27500,"v",0,0,"P43:851:852","A852" +"Satlink","Dunamis TV","dvbs",11471,27500,"v",0,0,"P150:151:152","A152" +"Satlink","FUEGO TV","dvbs",11471,27500,"v",0,0,"P1663:1661:1662","A1662" +"Satlink","RETECONOMY","dvbs",11471,27500,"v",0,0,"P49:1801:71","A71" +"Satlink","TELECOLORE","dvbs",11471,27500,"v",0,0,"P70:1811:1812","A1812" +"Satlink","Somali Channel","dvbs",11471,27500,"v",0,0,"P272:273:276","A276" +"Satlink","LA NUOVA TV","dvbs",11471,27500,"v",0,0,"P2180:851:852","A852" +"Harmonic","BLU LIVE","dvbs",11471,27500,"v",0,0,"P44:851:852","A852" +"Satlink","LINK TP 14","dvbs",11471,27500,"v",0,0,"P1650:851:852","A852" +"Satlink","BLU","dvbs",11471,27500,"v",0,0,"P850:851:852","A852" +"Satlink","DIRETTA TV","dvbs",11471,27500,"v",0,0,"P1870:1861:1862","A1862" +"Satlink","Napoli Mia","dvbs",11471,27500,"v",0,0,"P63:520:521","A521" +"Satlink","BLU SHOP","dvbs",11471,27500,"v",0,0,"P1640:851:852","A852" +"Satlink","TELENOVA","dvbs",11471,27500,"v",0,0,"P75:1841:1842","A1842" +"Satlink","I24 News English","dvbs",11471,27500,"v",0,0,"P2040:2041:2042","A2042" +"Satlink","SARSAT TV","dvbs",11471,27500,"v",0,0,"P2158:2143:2142","A2142" +"Satlink","SILVER TV","dvbs",11471,27500,"v",0,0,"P48:1661:1662","A1662" +"Satlink","ONE","dvbs",11471,27500,"v",0,0,"P1755:1756:1757","A1757" +"Satlink","JUSTICE TV","dvbs",11471,27500,"v",0,0,"P243:851:852","A852" +"Satlink","JUST ONE","dvbs",11471,27500,"v",0,0,"P1865:1756:1757","A1757" +"Satlink","Kalsan TV","dvbs",11471,27500,"v",0,0,"P400:401:402","A402" +"Satlink","CIAO SKY 899","dvbs",11471,27500,"v",0,0,"P1860:1861:1862","A1862" +"Satlink","LA9","dvbs",11471,27500,"v",0,0,"P2160:2161:2162","A2162" +"Satlink","FISHING TV","dvbs",11471,27500,"v",0,0,"P50:1745:1746","A1746" +"Satlink","EURSAT","dvbs",11471,27500,"v",0,0,"P1649:1661:1662","A1662" +"Satlink","TVA VICENZA","dvbs",11471,27500,"v",0,0,"P2170:2171:2172","A2172" +"Satlink","SUPERFLUO","dvbs",11471,27500,"v",0,0,"P1710:1861:1862","A1862" +"Satlink","STAR TV","dvbs",11471,27500,"v",0,0,"P140:141:142","A142" +"Satlink","NEW ONE","dvbs",11471,27500,"v",0,0,"P1730:1756:1757","A1757" +"Satlink","I24 News Arabic","dvbs",11471,27500,"v",0,0,"P2050:2051:2052","A2052" +"Satlink","VENUS TV","dvbs",11471,27500,"v",0,0,"P1648:1661:1662","A1662" +"Satlink","SUPER","dvbs",11471,27500,"v",0,0,"P2010:1861:1862","A1862" +"Satlink","ETV","dvbs",11471,27500,"v",0,0,"P130:131:132","A132" +"Satlink","Royal Somali TV","dvbs",11471,27500,"v",0,0,"P83:82:37","A37" +"Satlink","LAZIO CHANNEL","dvbs",11471,27500,"v",0,0,"P73:1661:1662","A1662" +"Satlink","CHAT","dvbs",11471,27500,"v",0,0,"P1800:1861:1862","A1862" +"Satlink","PIU TV","dvbs",11471,27500,"v",0,0,"P1910:1861:1862","A1862" +"Satlink","RETE ASTE","dvbs",11471,27500,"v",0,0,"P72:1831:1832","A1832" +"Satlink","LINK","dvbs",11471,27500,"v",0,0,"P2150:2151:2152","A2152" +"nc+","TV POLONIA","dvbs",11488,27500,"h",0,0,"P1001:160:500:80","A80" +"nc+","TV PULS","dvbs",11488,27500,"h",0,0,"P1042:171:512:124:125","A124:125" +"nc+","TVP Kultura","dvbs",11488,27500,"h",0,0,"P1043:172:513:128","A128" +"nc+","TVS","dvbs",11488,27500,"h",0,0,"P1002:161:508:84","A84" +"nc+","TVP Kultura","dvbs",11488,27500,"h",0,0,"P1013:172:513:128","A128" +"nc+","TV PULS","dvbs",11488,27500,"h",0,0,"P1012:171:512:124:125","A124:125" +"M-Three satcom","QVC","dvbs",11541,22000,"v",0,0,"P102:183:182","A182" +"M-Three satcom","EMPTY SERVICE","dvbs",11541,22000,"v",0,0,"P257","A" +"M-Three satcom","POLO TV","dvbs",11541,22000,"v",0,0,"P3623:6230:6231","A6231" +"M-Three satcom","POLO TV-1","dvbs",11541,22000,"v",0,0,"P3615:6230:6231","A6231" +"M-Three satcom","Romauno","dvbs",11541,22000,"v",0,0,"P3628:6280:6281","A6281" +"M-Three satcom","DAS ERSTE","dvbs",11541,22000,"v",0,0,"P3622:300:302:301","A301" +"TIMB","LA7ondemand","dvbs",11541,22000,"v",0,0,"P363","A" +"TIMB","CUBOVISION","dvbs",11541,22000,"v",0,0,"P3602","A" +"TIMB","HSE24","dvbs",11541,22000,"v",0,0,"P280:6250:6251","A6251" +"TIMB","DMAX","dvbs",11541,22000,"v",0,0,"P250:6270:6272:6271","A6271" +"RRSat","Wesal Haq","dvbs",11566,27500,"h",0,0,"P1014:2014:3014","A3014" +"OVERON","TBN Europe","dvbs",11566,27500,"h",0,0,"P1801:8001:8101","A8101" +"OVERON","TBN ITALIA","dvbs",11566,27500,"h",0,0,"P1803:8103:8003","A8003" +"OVERON","Church Channel","dvbs",11566,27500,"h",0,0,"P1804:8004:8104","A8104" +"OVERON","JCTV","dvbs",11566,27500,"h",0,0,"P1805:8005:8105","A8105" +"Unnamed","EL SHAFAA","dvbs",11566,27500,"h",0,0,"P1806:8006:8106","A8106" +"Overon","TBN Russia","dvbs",11566,27500,"h",0,0,"P1807:8007:8107","A8107" +"OVERON","Smile of a Child","dvbs",11566,27500,"h",0,0,"P1808:8008:8108","A8108" +"TBNFARSI","NEJAT TV","dvbs",11566,27500,"h",0,0,"P1809:8009:8109","A8109" +"Scopus","Pars TV","dvbs",11566,27500,"h",0,0,"P1810:8010:8110","A8110" +"Unknown","Service 811","dvbs",11566,27500,"h",0,0,"P1811:8011:8111","A8111" +"Overon","ChildRussia","dvbs",11566,27500,"h",0,0,"P1813:8013:8113","A8113" +"RRSat","NOOR TV","dvbs",11566,27500,"h",0,0,"P1815:8015:8115","A8115" +"RRSat","Shabakeh7","dvbs",11566,27500,"h",0,0,"P1817:8017:8117","A8117" +"RRSat","UNIVERSAL SOMALI TV","dvbs",11566,27500,"h",0,0,"P1821:8021:8121","A8121" +"RRSAT","Orient","dvbs",11566,27500,"h",0,0,"P1822:8022:8122","A8122" +"PITCOMM","IRAN E ARYAEE TV","dvbs",11566,27500,"h",0,0,"P1823:8023:8123","A8123" +"GlobeCast","Ahl Al Bhait","dvbs",11585,27500,"v",0,0,"P6126:1323:1333","A1333" +"GlobeCast","1+1 International","dvbs",11585,27500,"v",0,0,"P6125:1322:1332","A1332" +"GlobeCast","News 7","dvbs",11585,27500,"v",0,0,"P1227:1527:1528","A1528" +"GlobeCast","DAYSTAR TV","dvbs",11585,27500,"v",0,0,"P1204:1234:1244","A1244" +"GlobeCast",".Viva L'Italia Channel","dvbs",11585,27500,"v",0,0,"P516:1336:1346","A1346" +"GlobeCast","MADE IN ITALY","dvbs",11585,27500,"v",0,0,"P516:1336:1346","A1346" +"GlobeCast","KICC TV","dvbs",11585,27500,"v",0,0,"P601:1481:1482","A1482" +"GlobeCast","Ariana TV","dvbs",11585,27500,"v",0,0,"P506:1361:1362","A1362" +"GlobeCast","TISHK TV","dvbs",11585,27500,"v",0,0,"P1214:1414:1514","A1514" +"GlobeCast","EWTN UK","dvbs",11585,27500,"v",0,0,"P5008:1441:1442","A1442" +"TandbergTV","RBL.TV","dvbs",11585,27500,"v",0,0,"P1211:1411:1511","A1511" +"GLOBECAST","SAFO TV","dvbs",11585,27500,"v",0,0,"P","A" +"GlobeCast","Loveworld TV","dvbs",11585,27500,"v",0,0,"P","A" +"GlobeCast","TV9","dvbs",11585,27500,"v",0,0,"P","A" +"GlobeCast","!FunSpice","dvbs",11585,27500,"v",0,0,"P","A" +"MEDIA BROADCAST","MB SmartCast Test 9","dvbs",11604,27500,"h",0,0,"P500:3910:3920","A3920" +"MEDIA BROADCAST","DW Europe","dvbs",11604,27500,"h",0,0,"P700:1000:1003:1001","A1001" +"MEDIA BROADCAST","Arab-Girls.TV","dvbs",11604,27500,"h",0,0,"P1100:1110:1075:1120","A1120" +"MEDIA BROADCAST","4play games","dvbs",11604,27500,"h",0,0,"P1200:2410:1075:1220","A1220" +"MEDIA BROADCAST","arab-69.tv","dvbs",11604,27500,"h",0,0,"P1400:1075:1076","A1076" +"MEDIA BROADCAST","' ' Hot Arab Sex","dvbs",11604,27500,"h",0,0,"P1600:1080:1075:1081","A1081" +"MEDIA BROADCAST","121 Chat","dvbs",11604,27500,"h",0,0,"P1700:1086:1075:1087","A1087" +"MEDIA BROADCAST","Arab-Jins","dvbs",11604,27500,"h",0,0,"P1800:1090:1075:1091","A1091" +"MEDIA BROADCAST","Love TV","dvbs",11604,27500,"h",0,0,"P1810:1093:1075:1094","A1094" +"MEDIA BROADCAST","Lebnaniat TV.","dvbs",11604,27500,"h",0,0,"P1820:1097:1075:1098","A1098" +"MEDIA BROADCAST","Arab XXX","dvbs",11604,27500,"h",0,0,"P1900:1075:1920","A1920" +"MEDIA BROADCAST","7armanat Nar","dvbs",11604,27500,"h",0,0,"P2000:51:1075:52","A52" +"MEDIA BROADCAST","India Girls","dvbs",11604,27500,"h",0,0,"P2100:1080:1075:54","A54" +"MEDIA BROADCAST","+18 Love Girls","dvbs",11604,27500,"h",0,0,"P2200:1097:1075:2220","A2220" +"MEDIA BROADCAST","Sexy love girls","dvbs",11604,27500,"h",0,0,"P2300:2310:1075:2320","A2320" +"MEDIA BROADCAST",".arab babes","dvbs",11604,27500,"h",0,0,"P2400:2410:1075:2420","A2420" +"MEDIA BROADCAST","MB SmartCast Test 2","dvbs",11604,27500,"h",0,0,"P2500:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 8","dvbs",11604,27500,"h",0,0,"P2700:3910:3920","A3920" +"MEDIA BROADCAST","LOMBARDIA SAT","dvbs",11604,27500,"h",0,0,"P2800:2810:2820","A2820" +"MEDIA BROADCAST","KLIKSAT.farhad","dvbs",11604,27500,"h",0,0,"P2900:2910:2920","A2920" +"MEDIA BROADCAST","MB SmartCast Test 12","dvbs",11604,27500,"h",0,0,"P3200:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 14","dvbs",11604,27500,"h",0,0,"P3000:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 15","dvbs",11604,27500,"h",0,0,"P3600:3910:3920","A3920" +"MEDIA BROADCAST","TVRUS","dvbs",11604,27500,"h",0,0,"P3700:3710:3720","A3720" +"MEDIA BROADCAST","Juwelo","dvbs",11604,27500,"h",0,0,"P3800:3810:3820","A3820" +"MEDIA BROADCAST","MB SmartCast Test 1","dvbs",11604,27500,"h",0,0,"P3900:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 3","dvbs",11604,27500,"h",0,0,"P4200:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 4","dvbs",11604,27500,"h",0,0,"P4300:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 7","dvbs",11604,27500,"h",0,0,"P4500:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 5","dvbs",11604,27500,"h",0,0,"P4700:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 6","dvbs",11604,27500,"h",0,0,"P4800:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 16","dvbs",11604,27500,"h",0,0,"P5100:3910:3920","A3920" +"MEDIA BROADCAST","Persian Movie","dvbs",11604,27500,"h",0,0,"P6000:6010:6020","A6020" +"MEDIA BROADCAST","MB SmartCast Test 13","dvbs",11604,27500,"h",0,0,"P6200:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 10","dvbs",11604,27500,"h",0,0,"P6400:3910:3920","A3920" +"MEDIA BROADCAST","MB SmartCast Test 11","dvbs",11604,27500,"h",0,0,"P6500:3910:3920","A3920" +"MEDIA BROADCAST","IPN TV","dvbs",11604,27500,"h",0,0,"P","A" +"GLOBECAST","Pianeta TV","dvbs",11623,27500,"v",0,0,"P201:221:1024:241","A241" +"GlobeCast","MEDIATEXT.IT","dvbs",11623,27500,"v",0,0,"P202:222:242","A242" +"Unknown","ARTE","dvbs",11623,27500,"v",0,0,"P203:223:283:233:243:263:273","A233:243:263:273" +"GlobeCast","RTL 102.5 TV","dvbs",11623,27500,"v",0,0,"P203:224:244","A244" +"GlobeCast","Telepiù Channel","dvbs",11623,27500,"v",0,0,"P202:222:242","A242" +"GlobeCast","ITALIA_CHANNEL","dvbs",11623,27500,"v",0,0,"P206:226:246","A246" +"Unknown","TV_ROMANIA","dvbs",11623,27500,"v",0,0,"P207:227:287:247","A247" +"GlobeCast","Carisma_TV","dvbs",11623,27500,"v",0,0,"P4217:221:1024:241","A241" +"GlobeCast","ARTE OGGI TV","dvbs",11623,27500,"v",0,0,"P202:222:242","A242" +"GlobeCast","El Chourouk","dvbs",11623,27500,"v",0,0,"P210:230:250","A250" +"GlobeCast","Al Atlas","dvbs",11623,27500,"v",0,0,"P211:231:251","A251" +"Unknown","Arirang World","dvbs",11623,27500,"v",0,0,"P205:225:245","A245" +"GlobeCast","NESSMA MAGHREB MOYEN ORIENT","dvbs",11623,27500,"v",0,0,"P208:228:248","A248" +"GlobeCast","ETV Emilia R.","dvbs",11623,27500,"v",0,0,"P1202:221:241","A241" +"Unknown","ARTE","dvbs",11623,27500,"v",0,0,"P1203:223:283:233:243:263:273","A233:243:263:273" +"GlobeCast","RTG TV","dvbs",11623,27500,"v",0,0,"P335:235:2135:2137:2138","A2135:2137:2138" +"GlobeCast","METROSAT","dvbs",11623,27500,"v",0,0,"P738:221:241","A241" +"GlobeCast","Mediterraneo Sat","dvbs",11623,27500,"v",0,0,"P706:226:246","A246" +"GlobeCast","QUORE TV","dvbs",11623,27500,"v",0,0,"P747:226:246","A246" +"GlobeCast","Reality TV","dvbs",11623,27500,"v",0,0,"P748:221:1024:241","A241" +"BSS","KOMALA TV","dvbs",11642,27500,"h",0,0,"P1030:1031:1032","A1032" +"Unknown","AAA SPORT","dvbs",11642,27500,"h",0,0,"P1040:561:562","A562" +"BSS","Face 1","dvbs",11642,27500,"h",0,0,"P1050:1051:1052","A1052" +"BSS","AAA Family","dvbs",11642,27500,"h",0,0,"P560:561:562","A562" +"BSS","AAA Music","dvbs",11642,27500,"h",0,0,"P1070:1071:1072","A1072" +"BSS","KALEMEH FARSI","dvbs",11642,27500,"h",0,0,"P1200:1201:1202","A1202" +"BSS","Al Magharibia","dvbs",11642,27500,"h",0,0,"P1250:1251:1252","A1252" +"BSS","TV DISCO","dvbs",11642,27500,"h",0,0,"P1260:1261:1262","A1262" +"BSS","!mwala3a 3lik","dvbs",11642,27500,"h",0,0,"P1270:1271:1272","A1272" +"BSS","Anta 7iate","dvbs",11642,27500,"h",0,0,"P1280:1281:1282","A1282" +"BSS","Iran Fun","dvbs",11642,27500,"h",0,0,"P1290:1291:1292","A1292" +"BSS","Music Box Russia","dvbs",11642,27500,"h",0,0,"P1300:1301:1302","A1302" +"BSS","GOD TV","dvbs",11642,27500,"h",0,0,"P34:1321:1322","A1322" +"BSS","nar elhob","dvbs",11642,27500,"h",0,0,"P1340:1271:1272","A1272" +"BSS","lo3b whob","dvbs",11642,27500,"h",0,0,"P1360:1281:1282","A1282" +"BSS","GDG Channel","dvbs",11642,27500,"h",0,0,"P1430:1431:1432","A1432" +"Unknown","Wedding TV","dvbs",11642,27500,"h",0,0,"P1440:1441:1442","A1442" +"Unknown","Kurd Channel","dvbs",11642,27500,"h",0,0,"P1450:1451:1452","A1452" +"BSS","Hope Channel","dvbs",11642,27500,"h",0,0,"P1470:1471:1472:1473","A1472:1473" +"BSS","RVS Italy","dvbs",11642,27500,"h",0,0,"P1610:1471:1473","A1473" +"BSS","VENETO LINK","dvbs",11642,27500,"h",0,0,"P1620:1621:1622","A1622" +"BSS","ARTE CHIC","dvbs",11642,27500,"h",0,0,"P1630:1621:1622","A1622" +"BSS","SNTV","dvbs",11642,27500,"h",0,0,"P1700:1701:1702","A1702" +"Telespazio","Punto Sat","dvbs",11662,27500,"v",0,0,"P1695:334:335","A335" +"Telespazio","Challenger","dvbs",11662,27500,"v",0,0,"P1912:490:491:493","A491:493" +"Telespazio","Challenger","dvbs",11662,27500,"v",0,0,"P1913:490:491","A491" +"Telespazio","Informazione TV","dvbs",11662,27500,"v",0,0,"P1738:600:601","A601" +"Telespazio","Redlight 3D-HD!","dvbs",11662,27500,"v",0,0,"P611","A" +"Telespazio","Hustler 3D-HD!","dvbs",11662,27500,"v",0,0,"P612","A" +"Telespazio","TV Luna","dvbs",11662,27500,"v",0,0,"P1651","A" +"Telespazio","Sirio TV","dvbs",11662,27500,"v",0,0,"P1960:1920:1921","A1921" +"Telespazio","Sirio TV","dvbs",11662,27500,"v",0,0,"P1967:1920:1921","A1921" +"Telespazio","Sirio TV","dvbs",11662,27500,"v",0,0,"P1968:1920:1921","A1921" +"Telespazio","Sirio TV","dvbs",11662,27500,"v",0,0,"P1969:1920:1921","A1921" +"Telespazio","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1970:380:381","A381" +"Harmonic","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1971:380:381","A381" +"Harmonic","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1972:380:381","A381" +"Telespazio","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1973:380:381","A381" +"Telespazio","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1974:380:381","A381" +"Harmonic","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1975:380:381","A381" +"Telespazio","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1976:380:381","A381" +"Telespazio","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1977:380:381","A381" +"Telespazio","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1978:380:381","A381" +"Telespazio","Tivu Tivu","dvbs",11662,27500,"v",0,0,"P1979:380:381","A381" +"Eutelsat","Arte HD","dvbs",11681,27500,"h",0,0,"P570:571:572:573:574:577","A572:573:574:577" +"Telefonica Spain","TVE Internacional","dvbs",11727,27500,"v",0,0,"P33:2911:2913:2912:2915","A2912:2915" +"Telefonica Spain","Canal 24 Horas","dvbs",11727,27500,"v",0,0,"P34:3569:3571:3570:3573","A3570:3573" +"Telefonica Spain","TELESUR","dvbs",11727,27500,"v",0,0,"P43:3121:3122","A3122" +"TSA","SCT PROMO","dvbs",11727,27500,"v",0,0,"P56:41:36","A36" +"TSA","SCT PROMO b","dvbs",11727,27500,"v",0,0,"P62:41:36","A36" +"TSA","SCT PROMO c","dvbs",11727,27500,"v",0,0,"P63:41:36","A36" +"TSA","SCT PROMO d","dvbs",11727,27500,"v",0,0,"P64:41:36","A36" +"TSA","SCT PROMO e","dvbs",11727,27500,"v",0,0,"P35:41:36","A36" +"BBC World Service","BBC Arabic","dvbs",11727,27500,"v",0,0,"P6519:6781:6782","A6782" +"Du","Dubai TV","dvbs",11747,27500,"h",0,0,"P48:4130:4131:4132","A4131:4132" +"Du","Dubai Sports 3","dvbs",11747,27500,"h",0,0,"P49:4386:4387:4388","A4387:4388" +"Du","Sama Dubai","dvbs",11747,27500,"h",0,0,"P50:4642:4643","A4643" +"Du","AL SHARJAH","dvbs",11747,27500,"h",0,0,"P4340:4341:4342","A4342" +"Du","AD SPORT1","dvbs",11747,27500,"h",0,0,"P4370:4371:4372","A4372" +"Du","PMC","dvbs",11747,27500,"h",0,0,"P32:67:46","A46" +"Du","AL SHARQIYA","dvbs",11747,27500,"h",0,0,"P58:77:113","A113" +"Du","AL BAGHDADIA 2","dvbs",11747,27500,"h",0,0,"P4211:4222:4223","A4223" +"Du","AL BAGHDADIA","dvbs",11747,27500,"h",0,0,"P4251:4252:4253","A4253" +"Du","Al-Arabiya","dvbs",11747,27500,"h",0,0,"P35:515:643:671","A643:671" +"Du","MBC MAGHREB AL ARABIA","dvbs",11747,27500,"h",0,0,"P41:516:682","A682" +"Du","Sky News Arabia","dvbs",11747,27500,"h",0,0,"P4311:4312:4313","A4313" +"du","AL GHAD AL ARABY","dvbs",11747,27500,"h",0,0,"P4350:4351:4352","A4352" +"Rai","RaiMed","dvbs",11766,27500,"v",0,0,"P260:515:580:653","A653" +"Rai","Senato","dvbs",11766,27500,"v",0,0,"P1107:8190:588:92:660","A92:660" +"Rai","Rai Scuola","dvbs",11766,27500,"v",0,0,"P261:518:584:656","A656" +"Rai","TV2000","dvbs",11804,27500,"v",0,0,"P108:518:656","A656" +"Unknown","Service 3304","dvbs",11804,27500,"v",0,0,"P259:515:591:653","A653" +"Rai","Rai Gulp","dvbs",11804,27500,"v",0,0,"P126:522:590:663","A663" +"Rai","Rai Sport 1","dvbs",11804,27500,"v",0,0,"P128:512:581:650","A650" +"Rai","Rai Sport 2","dvbs",11804,27500,"v",0,0,"P104:516:579:654","A654" +"Rai","Rai Storia","dvbs",11804,27500,"v",0,0,"P103:514:583:652","A652" +"Rai","Camera Deputati","dvbs",11804,27500,"v",0,0,"P262:517:587:655","A655" +"Rai","RaiNettunoSat1","dvbs",11804,27500,"v",0,0,"P256:519:585:657","A657" +"NetMed","novasports7","dvbs",11823,27500,"h",0,0,"P269:519:8190:720:721","A720:721" +"NetMed","novasports7 Cy","dvbs",11823,27500,"h",0,0,"P271:519:8190:720:721","A720:721" +"SkyItalia","Real Time","dvbs",11958,27500,"v",0,0,"P1132:174:771:460:461","A460:461" +"JMC","TRT Belgesel","dvbs",12015,27500,"h",0,0,"P261:517:2309:277:700:701","A700:701" +"ART","IQRAA - ARABESQUE","dvbs",12015,27500,"h",0,0,"P264:520:136:730:1498","A730:1498" +"jmc","Iqraa Africa & Europe","dvbs",12015,27500,"h",0,0,"P258:521:182:731:732","A731:732" +"JMC","Algerie 3","dvbs",12015,27500,"h",0,0,"P272:525:142:5644","A5644" +"ART","Ictimai TV","dvbs",12015,27500,"h",0,0,"P273:524:140:5634","A5634" +"JMC","Canal Algerie","dvbs",12015,27500,"h",0,0,"P274:526:132:5654","A5654" +"JMC","RT DOC","dvbs",12015,27500,"h",0,0,"P397:1420:5664","A5664" +"JMC","Yemen TV","dvbs",12015,27500,"h",0,0,"P270:518:134:710","A710" +"JMC","Saudi Sports 1","dvbs",12015,27500,"h",0,0,"P281:776:150:1017","A1017" +"JMC","test","dvbs",12015,27500,"h",0,0,"P288:777:151:1018","A1018" +"Telespazio","Al Jazeera Documentary","dvbs",12111,27500,"v",0,0,"P1028:240:241","A241" +"Telespazio","Al Jazeera Mubasher","dvbs",12111,27500,"v",0,0,"P1029:250:251","A251" +"Telespazio","Al Jazeera","dvbs",12111,27500,"v",0,0,"P1031:270:271","A271" +"Telespazio","IP DATA","dvbs",12111,27500,"v",0,0,"P1065:1027","A" +"Telespazio","Telemarket for You","dvbs",12111,27500,"v",0,0,"P1038:329:328","A328" +"Telespazio","Antichità Chiossone","dvbs",12111,27500,"v",0,0,"P1139:3300:3310","A3310" +"Telespazio","S.NEU JERUSALEM","dvbs",12111,27500,"v",0,0,"P1173:345:346","A346" +"Harmonic","AL-MAYADEEN","dvbs",12111,27500,"v",0,0,"P1135:1403:2403","A2403" +"Telespazio","RIKSat","dvbs",12111,27500,"v",0,0,"P1194:108:2500:102","A102" +"Telespazio","ClassTv","dvbs",12111,27500,"v",0,0,"P1185:350:351","A351" +"Telespazio","Class Horse TV","dvbs",12111,27500,"v",0,0,"P1196:355:356","A356" +"Telespazio","TV Moda","dvbs",12111,27500,"v",0,0,"P1080:320:321","A321" +"Telespazio","Saamen Tv","dvbs",12111,27500,"v",0,0,"P1198:1168:1169","A1169" +"AH-EDP","Tunisie Nationale","dvbs",12149,27500,"v",0,0,"P42:112:114:113","A113" +"AH-EDP","Khabar TV","dvbs",12149,27500,"v",0,0,"P64:160:161","A161" +"AH-EDP","LIDER TV AZERBAIJAN","dvbs",12149,27500,"v",0,0,"P66:192:191:193:194","A193:194" +"AH-EDP","CCTV4","dvbs",12149,27500,"v",0,0,"P68:224:223:225","A225" +"EUTELSAT","SMtv San Marino","dvbs",12149,27500,"v",0,0,"P87:310:311","A311" +"People TV-Rete 7","People TV-Rete 7","dvbs",12149,27500,"v",0,0,"P1141:1142:1143","A1143" +"TandbergTV","CNC-002","dvbs",12149,27500,"v",0,0,"P3300:3304:3302:3303","A3303" +"Bahrain TV","Bahrain International","dvbs",12149,27500,"v",0,0,"P90:340:341","A341" +"BBC World Service","BBC Persian","dvbs",12149,27500,"v",0,0,"P111:410:411","A411" +"Scopus Network Technologies","BETHEL","dvbs",12149,27500,"v",0,0,"P88:420:421","A421" +"NetMed","ÂïõëÞ","dvbs",12169,27500,"h",0,0,"P278:517:8190:700","A700" +"Unknown","RFE/RL TV 1","dvbs",12226,27500,"v",0,0,"P5001:1160:1120:1122:1130:1132","A1120:1122:1130:1132" +"Unknown","VOA TV 240","dvbs",12226,27500,"v",0,0,"P5240:3260:3220:3222:3230:3232","A3220:3222:3230:3232" +"Unknown","VOA TV 241","dvbs",12226,27500,"v",0,0,"P5241:3260:3220:3230","A3220:3230" +"Unknown","VOA TV 242","dvbs",12226,27500,"v",0,0,"P5242:3260:3220:3232","A3220:3232" +"Unknown","VOA TV 251","dvbs",12226,27500,"v",0,0,"P5251:3260:3220:3230","A3220:3230" +"Unknown","VOA TV 252","dvbs",12226,27500,"v",0,0,"P5252:3260:3220:3232","A3220:3232" +"Unknown","DOS TV 340","dvbs",12226,27500,"v",0,0,"P5340:5060:5020","A5020" +"Unknown","Ch 500 - HD TEST","dvbs",12226,27500,"v",0,0,"P5500:560:32","A32" +"Unknown","VOA TV 100","dvbs",12226,27500,"v",0,0,"P5100:3260:3220:3222","A3220:3222" +"Unknown","AzadliqRadiosu TV 200","dvbs",12226,27500,"v",0,0,"P5200:1160:1120:1122","A1120:1122" +"Unknown","Alhurra TV 190","dvbs",12226,27500,"v",0,0,"P5190:1460:1420","A1420" +"Unknown","Alhurra TV 215","dvbs",12226,27500,"v",0,0,"P5215:1460:1420:1422","A1420:1422" +"Unknown","Radio Farda 223","dvbs",12226,27500,"v",0,0,"P5223:1560:1532","A1532" +"Unknown","Persian TV 225","dvbs",12226,27500,"v",0,0,"P5225:1660:1620:1622","A1620:1622" +"GlobeCast","Naba TV","dvbs",12245,27500,"h",0,0,"P33:112:122","A122" +"GlobeCast","Saudi Sport 2","dvbs",12245,27500,"h",0,0,"P113:123:133","A133" +"GlobeCast","Al sumariah","dvbs",12245,27500,"h",0,0,"P114:124:134","A134" +"GlobeCast","iTV","dvbs",12245,27500,"h",0,0,"P127:137:157","A157" +"GlobeCast","Al Etejah TV","dvbs",12245,27500,"h",0,0,"P1113:1123:1133","A1133" +"GlobeCast","AL BAGHDADIA","dvbs",12245,27500,"h",0,0,"P1115:1125:1135","A1135" +"GlobeCast","Saudi Arabian TV2","dvbs",12245,27500,"h",0,0,"P212:222:332","A332" +"GlobeCast","Samacom Test","dvbs",12245,27500,"h",0,0,"P","A" +"GlobeCast","Al Rasheed TV","dvbs",12245,27500,"h",0,0,"P","A" +"GlobeCast","KANAL 4","dvbs",12245,27500,"h",0,0,"P","A" +"GlobeCast","GEM Movie","dvbs",12245,27500,"h",0,0,"P","A" +"Cyfrowy Polsat S.A.","Blue Hustler","dvbs",12284,27500,"h",0,0,"P32","A" +"RIT","RIT-TV","dvbs",12322,27500,"h",0,0,"P32:33:34","A34" +"M-Three satcom","90 numeri sat","dvbs",12322,27500,"h",0,0,"P209:2090:2091","A2091" +"M-Three satcom","Bergamo TV","dvbs",12322,27500,"h",0,0,"P3931:3932:3933","A3933" +"M-Three satcom","Canale Aste","dvbs",12322,27500,"h",0,0,"P2062:2060:2061","A2061" +"Eutelsat","Romauno","dvbs",12322,27500,"h",0,0,"P5000:5010:5020","A5020" +"GlobeCast","Telepace","dvbs",12380,27500,"v",0,0,"P3017:3027:3037:3097","A3037:3097" +"GLOBECAST","AD AlOula","dvbs",12380,27500,"v",0,0,"P3014:3024:3034","A3034" +"GLOBECAST","ZAHRA TV","dvbs",12380,27500,"v",0,0,"P3019:3029:3039","A3039" +"GlobeCast","ERI TV","dvbs",12380,27500,"v",0,0,"P3110:3120:3130","A3130" +"GlobeCast","Saudi - Sunnah","dvbs",12380,27500,"v",0,0,"P3117:3127:3137","A3137" +"GlobeCast","KNN Channel","dvbs",12380,27500,"v",0,0,"P3108:3018:3048","A3048" +"GlobeCast","Libya Al Ahrar","dvbs",12380,27500,"v",0,0,"P3105:3025:3035","A3035" +"GlobeCast","Sat7 Plus","dvbs",12380,27500,"v",0,0,"P3013:3023:3033","A3033" +"GlobeCast","Al Etejah","dvbs",12380,27500,"v",0,0,"P3115:3215:3315","A3315" +"GlobeCast","AL SHARQIYA NEWS","dvbs",12380,27500,"v",0,0,"P3113:3213:3313","A3313" +"GlobeCast","ETV1","dvbs",12380,27500,"v",0,0,"P3100:3200:3300","A3300" +"Schweizer Radio und Fernsehen","SRF info","dvbs",12399,27500,"h",0,0,"P407:167:53:102:103:104","A102:103:104" +"RTV SLOVENIJA","SLO-TV3","dvbs",12520,27500,"v",0,0,"P82:218:202:219","A219" +"RTV SLOVENIJA","RBC-TV","dvbs",12520,27500,"v",0,0,"P32:603:604","A604" +"Telespazio","Canale ITALIA","dvbs",12558,27500,"v",0,0,"P1302:145:146","A146" +"Harmonic","Canale Italia 84","dvbs",12558,27500,"v",0,0,"P1303:245:246","A246" +"Telespazio","UnireSat by Teleippica","dvbs",12558,27500,"v",0,0,"P1310:1220:1221","A1221" +"Telespazio","TEF CHANNEL","dvbs",12558,27500,"v",0,0,"P1315:610:611:612","A611:612" +"Telespazio","THAQALLYN TV","dvbs",12558,27500,"v",0,0,"P33:52:50","A50" +"Telespazio","HODHOD Arabic","dvbs",12558,27500,"v",0,0,"P1323:1802:1803","A1803" +"Telespazio","HADI TV1","dvbs",12558,27500,"v",0,0,"P1345:72:73","A73" +"Telespazio","HADI TV3","dvbs",12558,27500,"v",0,0,"P420:410:411","A411" +"Telespazio","HADI TV4","dvbs",12558,27500,"v",0,0,"P1347:447:448","A448" +"Telespazio","RU TV","dvbs",12558,27500,"v",0,0,"P1349:2009:3009","A3009" +"Harmonic","Baraem+","dvbs",12558,27500,"v",0,0,"P2563:2851:2852","A2852" +"Harmonic","HODHOD FARSI","dvbs",12558,27500,"v",0,0,"P1360:360:361","A361" +"Telespazio","Jeem+","dvbs",12558,27500,"v",0,0,"P2819:2821:2822","A2822" +"GlobeCast","ARM_1","dvbs",12597,27500,"v",0,0,"P1025:161:84","A84" +"GlobeCast","BET","dvbs",12597,27500,"v",0,0,"P1026","A" +"GlobeCast","BBC World News","dvbs",12597,27500,"v",0,0,"P1027:163:92","A92" +"GlobeCast","SMNI","dvbs",12597,27500,"v",0,0,"P1056:4001:4011","A4011" +"Harmonic","1TVRUS Europe","dvbs",12597,27500,"v",0,0,"P1031:167:108","A108" +"GlobeCast","Euronews","dvbs",12597,27500,"v",0,0,"P1034:2221:768:2231:2232:2233:2234:2235:2236:2237:2238:2239:2240:2241:2242:2243:2246","A2231:2232:2233:2234:2235:2236:2237:2238:2239:2240:2241:2242:2243:2246" +"GlobeCast","Quadriga","dvbs",12597,27500,"v",0,0,"P1029","A" +"SkyItalia","Sky Calcio Info","dvbs",12616,29900,"h",0,0,"P1124:174","A" +"JMC","Qatar TV","dvbs",12654,27500,"h",0,0,"P5002:134:1220","A1220" +"ARABSAT","SAUDI1","dvbs",12654,27500,"h",0,0,"P5003:1360:1320","A1320" +"ARABSAT","KUWAIT","dvbs",12654,27500,"h",0,0,"P5004:1460:1420","A1420" +"Unknown","SUDAN TV","dvbs",12654,27500,"h",0,0,"P5032:1660:1620","A1620" +"ARABSAT","OMAN","dvbs",12654,27500,"h",0,0,"P5035:1760:1720","A1720" +"ARABSAT","ESC","dvbs",12654,27500,"h",0,0,"P5008:1860:1101:1206","A1206" +"ARABSAT","AL-IRAQIA TV","dvbs",12654,27500,"h",0,0,"P5061:1960:1920","A1920" +"ARABSAT","JORDAN TV","dvbs",12654,27500,"h",0,0,"P5049:4060:4020","A4020" +"ARABSAT","SAUDI-QURAN","dvbs",12654,27500,"h",0,0,"P5053:4260:4220","A4220" +"NILESAT","Libya Alwatnya","dvbs",12654,27500,"h",0,0,"P5054:4360:4320","A4320" +"SkyItalia","Sky Inside","dvbs",12673,29900,"v",0,0,"P286:2625:2626","A2626" +"SkyItalia","Sky Inside","dvbs",12673,29900,"v",0,0,"P310:2625:2626","A2626" +"SkyItalia","Sky Inside","dvbs",12673,29900,"v",0,0,"P312:2625:2626","A2626" +"SkyItalia","Sky Inside","dvbs",12673,29900,"v",0,0,"P313:2625:2626","A2626" +"Eutelsat","BFM TV","dvbs",12692,27500,"h",0,0,"P750:751:756:752","A752" +"AB SAT","BIS promo","dvbs",12692,27500,"h",0,0,"P417:117:217","A217" +"Eutelsat","TV8 Mont Blanc","dvbs",12692,27500,"h",0,0,"P820:821:822","A822" diff --git a/octoserve/var/channels/e9e.csv b/octoserve/var/channels/e9e.csv new file mode 100644 index 0000000..f5c79f4 --- /dev/null +++ b/octoserve/var/channels/e9e.csv @@ -0,0 +1,48 @@ +"CATEGORY","TITLE","SYSTEM","FREQ","SR","POL","RADIO","ENC","PIDS","TRACKS" +"???","Opap","dvbs",12265,27500,"v",0,0,"P368:468:130:768","A" +"Arqiva","ANN","dvbs",11727,27500,"v",0,0,"P260:2551:2552","A2552" +"Arqiva","Deepam TV","dvbs",11727,27500,"v",0,0,"P270:2701:2702","A2702" +"Arqiva","NTDTV","dvbs",11727,27500,"v",0,0,"P268:2631:2632","A2632" +"eVision","Duna","dvbs",12207,27500,"h",0,0,"P2713:2103:2501:2203","A2203" +"eVision","Duna HD","dvbs",11958,27500,"v",0,0,"P1713:1103:1501:1203","A1203" +"eVision","M1","dvbs",12207,27500,"h",0,0,"P2711:2111:2501","A" +"eVision","M1 HD","dvbs",11958,27500,"v",0,0,"P1711:1111:1501","A" +"eVision","M2","dvbs",12207,27500,"h",0,0,"P2712:2102:2501:2202","A2202" +"eVision","M2 HD","dvbs",11958,27500,"v",0,0,"P1712:1102:1501:1202","A1202" +"GlobeCast","777","dvbs",11938,27500,"h",0,0,"P109:1009:1109","A1109" +"GlobeCast","777-2","dvbs",11938,27500,"h",0,0,"P124:1024:1124","A1124" +"GlobeCast","CCTV9 DOCUMENTARY","dvbs",11938,27500,"h",0,0,"P111:1011:8190:1111","A1111" +"GlobeCast","Holy God","dvbs",11938,27500,"h",0,0,"P119:1019:1119","A1119" +"GlobeCast","Jaya TV","dvbs",11938,27500,"h",0,0,"P123:1231:1331","A1331" +"GlobeCast","JSTV","dvbs",11938,27500,"h",0,0,"P122:1003:1103","A1103" +"GlobeCast","M6 Suisse","dvbs",12034,27500,"v",0,0,"P5201:2010:2011:2012","A2011:2012" +"GlobeCast","M6 Suisse HD","dvbs",12034,27500,"v",0,0,"P5202:2020:2021:2022","A2021:2022" +"GlobeCast","NET 25 INTERNATIONAL","dvbs",11938,27500,"h",0,0,"P105:1005:1105","A1105" +"Globecast","Phoenix Info News","dvbs",12034,27500,"v",0,0,"P257:3531:3532","A3532" +"GlobeCast","PTV","dvbs",11938,27500,"h",0,0,"P102:1002:1102","A1102" +"GlobeCast","W9 Suisse","dvbs",12034,27500,"v",0,0,"P5203:2030:2031","A2031" +"GlobeCast","Walf TV","dvbs",11938,27500,"h",0,0,"P101:1001:1101","A1101" +"GlobeCast","YAARL TV","dvbs",11938,27500,"h",0,0,"P107:1007:1107","A1107" +"GlobeCast UK","CCTV-4","dvbs",11996,27500,"v",0,0,"P3998:3901:3999:3911","A3911" +"GlobeCast UK","CCTV-A","dvbs",11996,27500,"v",0,0,"P4298:4201:3999:4211","A4211" +"GlobeCast UK","CCTV-E","dvbs",11996,27500,"v",0,0,"P4098:4001:3999:4011","A4011" +"GlobeCast UK","CCTV-R","dvbs",11996,27500,"v",0,0,"P4198:4101:3999:4111","A4111" +"Harmonic","Parlamento","dvbs",12054,27500,"h",0,0,"P65:4129:4130","A4130" +"KabelKiosk","KabelKiosk - InfoKanal","dvbs",12360,27500,"h",0,0,"P2012:1121:1122","A1122" +"OTE","?????","dvbs",12149,27500,"v",0,0,"P305:405:505","A505" +"OTE","4E","dvbs",12149,27500,"v",0,0,"P312:412:512","A512" +"RRSat","!ana bintizarek","dvbs",11919,27500,"v",0,0,"P1023:2023:3023","A3023" +"RRSat","Angel TV","dvbs",11919,27500,"v",0,0,"P1036:2036:3036","A3036" +"RRSat","anta oana obs","dvbs",11919,27500,"v",0,0,"P1024:2024:3024","A3024" +"RRSat","DIVINE TV","dvbs",11919,27500,"v",0,0,"P1014:2014:3014","A3014" +"RRSat","NLM TV","dvbs",11919,27500,"v",0,0,"P1017:2017:3017","A3017" +"Satlink","Apostolic Oneness Network","dvbs",11900,27500,"h",0,0,"P256:512:63","A63" +"Telefonica Spain","Real Madrid TV","dvbs",12054,27500,"h",0,0,"P32:1113:1123","A1123" +"TS Pro","TF1 Suisse","dvbs",12034,27500,"v",0,0,"P200:210:230:220:221:222","A220:221:222" +"TSA","Record News","dvbs",12054,27500,"h",0,0,"P1029:1024:1040:1056","A1040:1056" +"Unknown","EbS","dvbs",11900,27500,"h",0,0,"P233:200:201:202:203:204:205:206:207:208:209:210:211:212:213:214:215:216:217:218:219:220","A201:202:203:204:205:206:207:208:209:210:211:212:213:214:215:216:217:218:219:220" +"Unknown","EbS+","dvbs",11900,27500,"h",0,0,"P433:400:401:402:403:404:405:406:407:408:409:410:411:412:413:414:415:416:417:418:419:420","A401:402:403:404:405:406:407:408:409:410:411:412:413:414:415:416:417:418:419:420" +"Unknown","Pentagon Channel","dvbs",11804,27500,"v",0,0,"P5008:810:800:802:804:806","A800:802:804:806" +"Unknown","Program-11","dvbs",11919,27500,"v",0,0,"P1026:2026:3026","A3026" +"Unknown","Program-9","dvbs",11919,27500,"v",0,0,"P1025:2025:3025","A3025" +"Unknown","TF1 HD Suisse","dvbs",12034,27500,"v",0,0,"P800:810:820:821:822","A820:821:822" diff --git a/octoserve/var/channels/kbw.csv b/octoserve/var/channels/kbw.csv new file mode 100644 index 0000000..c06af45 --- /dev/null +++ b/octoserve/var/channels/kbw.csv @@ -0,0 +1,121 @@ +"CATEGORY","TITLE","SYSTEM","FREQ","SR","MOD","RADIO","ENC","PIDS","TRACKS" +"1","1-2-3.tv","dvbc",122000,6900,"256qam",0,0,"P801:802:810:803","A803" +"3","3sat","dvbc",370000,6900,"256qam",0,0,"P200:210:230:220:221:222:225","A220:221:222:225" +"A","AJ Children","dvbc",826000,6900,"64qam",0,0,"P501:502:503","A503" +"A","Al Auola Inter","dvbc",818000,6900,"64qam",0,0,"P701:702:703","A703" +"A","Al Jazeera","dvbc",570000,6900,"256qam",0,0,"P701:702:703","A703" +"A","Al Jazeera International","dvbc",570000,6900,"256qam",0,0,"P201:202:203","A203" +"A","arirang","dvbc",826000,6900,"64qam",0,0,"P301:302:303","A303" +"A","arte","dvbc",362000,6900,"256qam",0,0,"P400:401:404:402:403","A402:403" +"A","Astro TV","dvbc",546000,6900,"256qam",0,0,"P1201:1202:1203","A1203" +"B","Bayerisches FS Nord","dvbc",346000,6900,"256qam",0,0,"P500:201:204:202:203:206","A202:203:206" +"B","Bayerisches FS Süd","dvbc",346000,6900,"256qam",0,0,"P200:201:204:202:203:206","A202:203:206" +"B","BBC PARLIAMENT","dvbc",610000,6900,"64qam",0,0,"P301:302:310:303","A303" +"B","BBC World News","dvbc",570000,6900,"256qam",0,0,"P901:902:903","A903" +"B","Bibel TV","dvbc",466000,6900,"256qam",0,0,"P901:902:910:903","A903" +"B","Bloomberg","dvbc",554000,6900,"256qam",0,0,"P401:402:410:403","A403" +"B","BR-alpha","dvbc",362000,6900,"256qam",0,0,"P1400:1401:1404:1402:1403:1406","A1402:1403:1406" +"B","BVN","dvbc",810000,6900,"64qam",0,0,"P1101:1102:1112:1110:1103","A1103" +"B","bw family","dvbc",130000,6900,"256qam",0,0,"P501:502:503:504","A503:504" +"C","Camera dei Deputati","dvbc",818000,6900,"64qam",0,0,"P201:202:210:203","A203" +"C","CCTV 9","dvbc",818000,6900,"64qam",0,0,"P1201:1202:1203","A1203" +"C","CCTV News","dvbc",570000,6900,"256qam",0,0,"P601:602:612:603","A603" +"C","Channel21","dvbc",122000,6900,"256qam",0,0,"P501:502:510:503","A503" +"C","CNN","dvbc",122000,6900,"256qam",0,0,"P901:902:903","A903" +"D","DAF-AnlegerTV","dvbc",818000,6900,"64qam",0,0,"P1301:1302:1303","A1303" +"D","Das Erste","dvbc",346000,6900,"256qam",0,0,"P100:101:104:102:103:106","A102:103:106" +"D","Das Erste HD","dvbc",362000,6900,"256qam",0,0,"P6000:6010:6030:6020:6021:6022","A6020:6021:6022" +"D","DAS VIERTE","dvbc",450000,6900,"256qam",0,0,"P101:102:110:103","A103" +"D","DELUXE MUSIC","dvbc",442000,6900,"256qam",0,0,"P601:602:603","A603" +"D","DIE NEUE ZEIT TV","dvbc",570000,6900,"256qam",0,0,"P1201:1202:1203","A1203" +"D","DM Digital","dvbc",738000,6900,"256qam",0,0,"P201:202:203","A203" +"D","DMAX","dvbc",122000,6900,"256qam",0,0,"P201:202:210:203","A203" +"D","DUNA","dvbc",810000,6900,"64qam",0,0,"P601:602:610:603","A603" +"D","DUNA II Atonomia","dvbc",810000,6900,"64qam",0,0,"P501:502:510:503","A503" +"E","EinsFestival","dvbc",362000,6900,"256qam",0,0,"P200:201:204:202:203:206","A202:203:206" +"E","EinsPlus","dvbc",362000,6900,"256qam",0,0,"P300:301:304:302:303:306","A302:303:306" +"E","ERF eins","dvbc",810000,6900,"64qam",0,0,"P301:302:303","A303" +"E","ETNO TV","dvbc",826000,6900,"64qam",0,0,"P601:602:603","A603" +"E","euronews","dvbc",426000,6900,"256qam",0,0,"P1101:1102:1110:1103:1104:1105:1106:1113:1114:1115:1116:1117:1118:1119:1120:1121","A1103:1104:1105:1106:1113:1114:1115:1116:1117:1118:1119:1120:1121" +"E","EUROSPORT","dvbc",450000,6900,"256qam",0,0,"P301:302:310:303","A303" +"F","France 24","dvbc",570000,6900,"256qam",0,0,"P101:102:103","A103" +"H","HABERTÜRK","dvbc",730000,6900,"256qam",0,0,"P1101:1102:1112:1103","A1103" +"H","HD Campus TV","dvbc",130000,6900,"256qam",0,0,"P301:302:312:303","A303" +"H","hr-fernsehen","dvbc",346000,6900,"256qam",0,0,"P300:301:304:302:303","A302:303" +"H","HSE24","dvbc",442000,6900,"256qam",0,0,"P801:802:810:803","A803" +"H","HSE24 EXTRA","dvbc",442000,6900,"256qam",0,0,"P1101:1102:1110:1103","A1103" +"I","iM1","dvbc",442000,6900,"256qam",0,0,"P401:402:403","A403" +"I","Info KabelBW","dvbc",130000,6900,"256qam",0,0,"P101:102:103","A103" +"J","Juwelo","dvbc",442000,6900,"256qam",0,0,"P501:502:503","A503" +"K","K-TV","dvbc",466000,6900,"256qam",0,0,"P1301:1302:1310:1303","A1303" +"K","kabel eins","dvbc",114000,6900,"256qam",0,0,"P601:602:610:603","A603" +"K","KabelBW Videothek","dvbc",610000,6900,"64qam",0,0,"P101:102:103","A103" +"K","KBW Test SD","dvbc",130000,6900,"256qam",0,0,"P401","A" +"K","Khabar TV","dvbc",818000,6900,"64qam",0,0,"P101:102:103","A103" +"K","KiKA","dvbc",370000,6900,"256qam",0,0,"P300:310:330:320:321:325","A320:321:325" +"M","MDR S-Anhalt","dvbc",354000,6900,"256qam",0,0,"P2900:2901:2904:2902:2903","A2902:2903" +"M","MDR Sachsen","dvbc",354000,6900,"256qam",0,0,"P2800:2901:2904:2902:2903","A2902:2903" +"M","MDR Thüringen","dvbc",354000,6900,"256qam",0,0,"P3000:2901:2904:2902:2903","A2902:2903" +"M","Mohajer","dvbc",818000,6900,"64qam",0,0,"P401:402:403","A403" +"N","n-tv","dvbc",114000,6900,"256qam",0,0,"P801:802:810:803","A803" +"N","N24","dvbc",114000,6900,"256qam",0,0,"P901:902:910:903","A903" +"N","NDR FS HH","dvbc",354000,6900,"256qam",0,0,"P2500:2601:2604:2602:2603","A2602:2603" +"N","NDR FS MV","dvbc",354000,6900,"256qam",0,0,"P2400:2601:2604:2602:2603","A2602:2603" +"N","NDR FS NDS","dvbc",354000,6900,"256qam",0,0,"P2600:2601:2604:2602:2603","A2602:2603" +"N","NDR FS SH","dvbc",354000,6900,"256qam",0,0,"P2700:2601:2604:2602:2603","A2602:2603" +"N","Nick/Comedy Central","dvbc",450000,6900,"256qam",0,0,"P201:202:5412:210:203","A203" +"O","OCKO","dvbc",810000,6900,"64qam",0,0,"P1201:1202:1210:1203","A1203" +"O","ORF2E","dvbc",738000,6900,"256qam",0,0,"P701:702:710:703","A703" +"P","PCNE Chinese","dvbc",810000,6900,"64qam",0,0,"P901:902:912:903:904","A903:904" +"P","PHOENIX","dvbc",362000,6900,"256qam",0,0,"P500:501:504:502:503","A502:503" +"P","Pro TV International","dvbc",818000,6900,"64qam",0,0,"P501:502:503","A503" +"P","ProSieben","dvbc",114000,6900,"256qam",0,0,"P301:302:310:303:307","A303:307" +"Q","QVC","dvbc",442000,6900,"256qam",0,0,"P701:702:710:703","A703" +"Q","QVC Beauty","dvbc",442000,6900,"256qam",0,0,"P1001:1002:1010:1003","A1003" +"Q","QVC HD","dvbc",762000,6900,"64qam",0,0,"P201:202:210:207","A207" +"Q","QVC Plus","dvbc",442000,6900,"256qam",0,0,"P301:302:310:303","A303" +"R","rbb Berlin","dvbc",354000,6900,"256qam",0,0,"P600:601:604:602:603","A602:603" +"R","rbb Brandenburg","dvbc",354000,6900,"256qam",0,0,"P500:601:604:602:603","A602:603" +"R","Record TV","dvbc",562000,6900,"256qam",0,0,"P1101:1102:1103","A1103" +"R","RTL NITRO","dvbc",122000,6900,"256qam",0,0,"P101:102:110:103","A103" +"R","RTL Television","dvbc",114000,6900,"256qam",0,0,"P101:102:110:103:107","A103:107" +"R","RTL2","dvbc",114000,6900,"256qam",0,0,"P501:502:510:503","A503" +"R","Russia Today","dvbc",570000,6900,"256qam",0,0,"P401:402:403","A403" +"S","SAT.1","dvbc",114000,6900,"256qam",0,0,"P201:202:210:203:207","A203:207" +"S","Sat.1 Gold","dvbc",122000,6900,"256qam",0,0,"P701:702:710:703","A703" +"S","Servus TV","dvbc",442000,6900,"256qam",0,0,"P101:102:110:103:104","A103:104" +"S","ServusTV HD","dvbc",762000,6900,"64qam",0,0,"P401:402:410:403:404:407","A403:404:407" +"S","SF1","dvbc",738000,6900,"256qam",0,0,"P501:502:510:503:504","A503:504" +"S","SF2","dvbc",738000,6900,"256qam",0,0,"P601:602:610:603:604","A603:604" +"S","SIXX","dvbc",122000,6900,"256qam",0,0,"P301:302:310:303","A303" +"S","Sky Select","dvbc",402000,6900,"256qam",0,0,"P103:2815:2816:2819","A2816:2819" +"S","SonLife","dvbc",818000,6900,"64qam",0,0,"P1001:1002:1003","A1003" +"S","sonnenklar.TV","dvbc",122000,6900,"256qam",0,0,"P401:402:410:403","A403" +"S","Souvenirs from earth","dvbc",554000,6900,"256qam",0,0,"P1101:1102:1103","A1103" +"S","Sparda Welt","dvbc",130000,6900,"256qam",0,0,"P201:202:203","A203" +"S","SPORT1","dvbc",450000,6900,"256qam",0,0,"P2101:2102:2110:2103","A2103" +"S","Super RTL","dvbc",114000,6900,"256qam",0,0,"P701:702:710:703","A703" +"S","SWR Fernsehen BW","dvbc",346000,6900,"256qam",0,0,"P800:801:804:802:803:806","A802:803:806" +"S","SWR Fernsehen RP","dvbc",354000,6900,"256qam",0,0,"P3100:3101:3104:3102:3103:3106","A3102:3103:3106" +"T","tagesschau24","dvbc",362000,6900,"256qam",0,0,"P100:101:104:102","A102" +"T","Tele 5","dvbc",450000,6900,"256qam",0,0,"P2201:2202:2210:2203","A2203" +"T","TF 1","dvbc",826000,6900,"64qam",0,0,"P101:102:110:103:104:105","A103:104:105" +"T","Thai Global Networks","dvbc",826000,6900,"64qam",0,0,"P401:402:403","A403" +"T","TRT Türk","dvbc",434000,6900,"256qam",0,0,"P1201:1202:1210:1203","A1203" +"T","TV 8","dvbc",826000,6900,"64qam",0,0,"P201:202:203","A203" +"T","TV Chile Nordic","dvbc",810000,6900,"64qam",0,0,"P201:202:203","A203" +"T","TV GALICIA","dvbc",810000,6900,"64qam",0,0,"P801:802:810:803","A803" +"T","TV ROMANIA International","dvbc",810000,6900,"64qam",0,0,"P401:402:410:403","A403" +"T","TV Südbaden","dvbc",130000,6900,"256qam",0,0,"P601:602:610:603","A603" +"T","TV Tunisia 1","dvbc",810000,6900,"64qam",0,0,"P701:702:710:703","A703" +"T","TV5MONDE Europe","dvbc",122000,6900,"256qam",0,0,"P1001:1002:1010:1003","A1003" +"V","Viva","dvbc",122000,6900,"256qam",0,0,"P601:602:612:610:603","A603" +"V","VOX","dvbc",114000,6900,"256qam",0,0,"P401:402:410:403","A403" +"W","WDR Köln","dvbc",346000,6900,"256qam",0,0,"P600:601:604:602:603","A602:603" +"W","World Fashion","dvbc",810000,6900,"64qam",0,0,"P1001:1002:1003","A1003" +"Z","ZDF","dvbc",370000,6900,"256qam",0,0,"P100:110:130:120:121:122:125","A120:121:122:125" +"Z","ZDF HD","dvbc",370000,6900,"256qam",0,0,"P6100:6110:6130:6120:6121:6122:6123","A6120:6121:6122:6123" +"Z","zdf_neo","dvbc",370000,6900,"256qam",0,0,"P650:660:680:670:671:672:675","A670:671:672:675" +"Z","zdf.kultur","dvbc",370000,6900,"256qam",0,0,"P1100:1110:1130:1120:1121:1122:1125","A1120:1121:1122:1125" +"Z","ZDFinfo","dvbc",370000,6900,"256qam",0,0,"P600:610:630:620:621:622:625","A620:621:622:625" +"Z","Zing","dvbc",810000,6900,"64qam",0,0,"P101:102:110:103","A103" diff --git a/octoserve/var/channels/kd.csv b/octoserve/var/channels/kd.csv new file mode 100644 index 0000000..02cfc10 --- /dev/null +++ b/octoserve/var/channels/kd.csv @@ -0,0 +1,66 @@ +CATEGORY,TITLE,SYSTEM,FREQ,SR,MOD,RADIO,ENC,PIDS,TRACKS +"Digital Free","arte HD","dvbc",114000,6900,"256qam",0,0,"P105:6661:6664:6662:6663","A6662:6663" +"ARD","Das Erste HD","dvbc",330000,6900,"256qam",0,0,"P5100:5101:5104:5102:5103","A5102:5103" +"ARD","BR-alpha","dvbc",330000,6900,"256qam",0,0,"P1400:1401:1404:1402:1403:1406","A1402:1403:1406" +"ARD","tagesschau24","dvbc",330000,6900,"256qam",0,0,"P100:101:104:102","A102" +"ARD","Einsfestival","dvbc",330000,6900,"256qam",0,0,"P200:201:204:202:203:206","A202:203:206" +"ARD","EinsPlus","dvbc",330000,6900,"256qam",0,0,"P300:301:304:302:303:306","A302:303:306" +"ARD","arte","dvbc",330000,6900,"256qam",0,0,"P400:401:404:402:403","A402:403" +"ARD","PHOENIX","dvbc",330000,6900,"256qam",0,0,"P500:501:504:502:503","A502:503" +"ARD","Das Erste","dvbc",338000,6900,"256qam",0,0,"P100:101:104:102:103:106","A102:103:106" +"ARD","Bayerisches FS Süd","dvbc",338000,6900,"256qam",0,0,"P200:201:204:202:203:206","A202:203:206" +"ARD","hr-fernsehen","dvbc",338000,6900,"256qam",0,0,"P300:301:304:302:303","A302:303" +"ARD","WDR Köln","dvbc",338000,6900,"256qam",0,0,"P600:601:604:602:603","A602:603" +"ARD","SWR Fernsehen RP","dvbc",338000,6900,"256qam",0,0,"P800:801:804:802:803:806","A802:803:806" +"SKY","Sky Select","dvbc",378000,6900,"256qam",0,0,"P103:2815:2816:2819","A2816:2819" +"Digital Free","Super RTL","dvbc",394000,6900,"256qam",0,0,"P111:1501:1504:1502","A1502" +"Digital Free","RTL II","dvbc",394000,6900,"256qam",0,0,"P112:1601:1604:1602","A1602" +"Digital Free","VOX","dvbc",394000,6900,"256qam",0,0,"P113:1701:1704:1702","A1702" +"Digital Free","n-tv","dvbc",394000,6900,"256qam",0,0,"P114:1901:1904:1902","A1902" +"Digital Free","SPORT1","dvbc",394000,6900,"256qam",0,0,"P116:2501:2504:2502","A2502" +"Digital Free","1-2-3.tv","dvbc",402000,6900,"256qam",0,0,"P103:1101:1104:1102","A1102" +"Digital Free","BBC World News","dvbc",402000,6900,"256qam",0,0,"P115:401:402","A402" +"Digital Free","RTL NITRO","dvbc",402000,6900,"256qam",0,0,"P105:981:984:982","A982" +"Digital Free","CNN","dvbc",402000,6900,"256qam",0,0,"P110:2251:2252","A2252" +"Digital Free","Servus TV","dvbc",402000,6900,"256qam",0,0,"P107:2371:2374:2372","A2372" +"Digital Free","EuroNews","dvbc",410000,6900,"256qam",0,0,"P111:2601:2622","A2622" +"Italienisch","EuroNews","dvbc",410000,6900,"256qam",0,0,"P106:2601:1202","A1202" +"Div. Sprachen","EuroNews","dvbc",410000,6900,"256qam",0,0,"P107:2601:1212","A1212" +"Div. Sprachen","EuroNews","dvbc",410000,6900,"256qam",0,0,"P108:2601:1222","A1222" +"Russisch","EuroNews","dvbc",410000,6900,"256qam",0,0,"P109:2601:1232","A1232" +"Digital Free","Channel21","dvbc",410000,6900,"256qam",0,0,"P114:2391:2394:2392","A2392" +"Digital Free","Juwelo TV","dvbc",410000,6900,"256qam",0,0,"P113:2361:2362","A2362" +"Digital Free","EuroNews","dvbc",410000,6900,"256qam",0,0,"P110:2601:2602","A2602" +"Digital Free","Bloomberg","dvbc",426000,6900,"256qam",0,0,"P102:421:422","A422" +"Digital Free","Bibel TV","dvbc",426000,6900,"256qam",0,0,"P106:731:734:732","A732" +"Digital Free","ERF eins","dvbc",426000,6900,"256qam",0,0,"P108:2411:2412","A2412" +"Digital Free","Das Vierte","dvbc",426000,6900,"256qam",0,0,"P107:2931:2934:2932","A2932" +"Digital Free","sonnenklar.TV","dvbc",426000,6900,"256qam",0,0,"P105:2271:2274:2272","A2272" +"Digital Free","sixx","dvbc",442000,6900,"256qam",0,0,"P104:1181:1184:1182","A1182" +"Digital Free","Tele 5","dvbc",442000,6900,"256qam",0,0,"P115:411:414:412","A412" +"Digital Free","Eurosport","dvbc",442000,6900,"256qam",0,0,"P113:2921:2924:2922","A2922" +"Digital Free","ProSieben","dvbc",442000,6900,"256qam",0,0,"P101:2201:2204:2202:2203","A2202:2203" +"Digital Free","kabel eins","dvbc",442000,6900,"256qam",0,0,"P109:2301:2304:2302","A2302" +"Digital Free","N24","dvbc",442000,6900,"256qam",0,0,"P114:2801:2804:2802","A2802" +"ZDFvision","ZDF HD","dvbc",450000,6900,"256qam",0,0,"P6100:6110:6130:6120:6121:6123","A6120:6121:6123" +"ZDFvision","ZDF","dvbc",450000,6900,"256qam",0,0,"P100:110:130:120:121:122:125","A120:121:122:125" +"ZDFvision","3sat","dvbc",450000,6900,"256qam",0,0,"P200:210:230:220:221:222:225","A220:221:222:225" +"ZDFvision","KiKA","dvbc",450000,6900,"256qam",0,0,"P300:310:330:320:321:325","A320:321:325" +"ZDFvision","ZDFinfo","dvbc",450000,6900,"256qam",0,0,"P600:610:630:620:621:622:625","A620:621:622:625" +"ZDFvision","zdf_neo","dvbc",450000,6900,"256qam",0,0,"P650:660:680:670:671:672:675","A670:671:672:675" +"ZDFvision","zdf.kultur","dvbc",450000,6900,"256qam",0,0,"P1100:1110:1130:1120:1121:1122:1125","A1120:1121:1122:1125" +"ARD","rbb Berlin","dvbc",458000,6900,"256qam",0,0,"P600:601:604:602:603","A602:603" +"ARD","NDR FS MV","dvbc",458000,6900,"256qam",0,0,"P2400:2401:2404:2402:2403","A2402:2403" +"ARD","MDR Sachsen","dvbc",458000,6900,"256qam",0,0,"P2800:2801:2804:2802:2803","A2802:2803" +"Digital Free","NICK/COMEDY CENTRAL","dvbc",466000,6900,"256qam",0,0,"P104:441:444:442","A442" +"Digital Free","VIVA","dvbc",466000,6900,"256qam",0,0,"P116:2941:2944:2942","A2942" +"Digital Free","QVC","dvbc",466000,6900,"256qam",0,0,"P101:2281:2284:2282","A2282" +"Digital Free","DMAX","dvbc",466000,6900,"256qam",0,0,"P115:2291:2294:2292","A2292" +"Digital Free","HSE24","dvbc",466000,6900,"256qam",0,0,"P103:2311:2314:2312","A2312" +"Digital Free","Kabel Digital Info","dvbc",538000,6900,"256qam",0,0,"P104:2741:2742","A2742" +"Digital Free","ANIXE SD","dvbc",538000,6900,"256qam",0,0,"P109:1001:1002","A1002" +"Digital Free","SAT.1 Gold","dvbc",538000,6900,"256qam",0,0,"P112:2431:2434:2432","A2432" +"Digital Free","Astro TV","dvbc",538000,6900,"256qam",0,0,"P101:2241:2242","A2242" +"Digital Free","Joiz!","dvbc",626000,6900,"256qam",0,0,"P103:6421:6422","A6422" +"Digital Free","ProSieben MAXX","dvbc",626000,6900,"256qam",0,0,"P104:6431:6434:6432:6433","A6432:6433" +"Digital Free","Deutsches Musikfernsehen","dvbc",626000,6900,"256qam",0,0,"P109:6501:6502","A6502" diff --git a/octoserve/var/channels/kdc2.csv b/octoserve/var/channels/kdc2.csv new file mode 100644 index 0000000..bda6b37 --- /dev/null +++ b/octoserve/var/channels/kdc2.csv @@ -0,0 +1,5 @@ +CATEGORY,TITLE,SYSTEM,FREQ,BW/SR,DS,PLP,MOD,RADIO,ENC,PIDS,TRACKS +"KDC2","KDG C2 Demo 1","dvbc2",793982,8,0,0,"",0,0,"P100:308:256","A256" +"KDC2","KDG C2 Demo 2","dvbc2",793982,8,0,0,"",0,0,"P100:308:256","A256" +"TEST","Test DS0","dvbc2",793982,8,0,0,"",0,0,"P100:308:256","A256" +"TEST","Test DS1","dvbc2",793982,8,1,257,"",0,0,"P32:256:272","A272" diff --git a/octoserve/var/channels/readme.txt b/octoserve/var/channels/readme.txt new file mode 100644 index 0000000..757d77e --- /dev/null +++ b/octoserve/var/channels/readme.txt @@ -0,0 +1,3 @@ + +File format is subject to change + diff --git a/octoserve/var/channels/sourcelist.csv b/octoserve/var/channels/sourcelist.csv new file mode 100644 index 0000000..a11cb6b --- /dev/null +++ b/octoserve/var/channels/sourcelist.csv @@ -0,0 +1,8 @@ +KEY,CSVFILE,NAME,SYSTEM,SRC +"KBW","kbw","KabelBW","dvbc",0 +"UM","um","UnityMedia","dvbc",0 +"KD","kd","Kabel Deutschland","dvbc",0 +"KDC2","kdc2","Kabel Deutschland C2","dvbc2",0 +"A19E","a19e","Astra 19E","dvbs",1 +"E9E","e9e","Eutelsat 9E","dvbs",1 +"E13E","e13e","Hotbird 13E","dvbs",1 \ No newline at end of file diff --git a/octoserve/var/channels/um.csv b/octoserve/var/channels/um.csv new file mode 100644 index 0000000..a8b3327 --- /dev/null +++ b/octoserve/var/channels/um.csv @@ -0,0 +1,104 @@ +CATEGORY,TITLE,SYSTEM,FREQ,SR,MOD,RADIO,ENC,PIDS,TRACKS +"Unitymedia","ProSieben MAXX","dvbc",113000,6900,"256qam",0,0,"P267:613:618:614","A614" +"Unitymedia","DAF - Anleger TV","dvbc",129000,6900,"256qam",0,0,"P264:583:584","A584" +"Unitymedia","Offener Kanal","dvbc",129000,6900,"256qam",0,0,"P263:573:574","A574" +"Unitymedia","Rhein-Main-TV","dvbc",129000,6900,"256qam",0,0,"P267:613:618:614","A614" +"Unitymedia","Unitymedia Infokanal","dvbc",129000,6900,"256qam",0,0,"P257:513:518:514","A514" +"SKY","Sky Select","dvbc",378000,6900,"256qam",0,0,"P103:2815:2816:2819","A2816:2819" +"ZDFvision","ZDF HD","dvbc",394000,6900,"256qam",0,0,"P6100:6110:6130:6120:6121:6122:6123","A6120:6121:6122:6123" +"ZDFvision","ZDF","dvbc",394000,6900,"256qam",0,0,"P100:110:130:120:121:122:125","A120:121:122:125" +"ZDFvision","3sat","dvbc",394000,6900,"256qam",0,0,"P200:210:230:220:221:222:225","A220:221:222:225" +"ZDFvision","KiKA","dvbc",394000,6900,"256qam",0,0,"P300:310:330:320:321:325","A320:321:325" +"ZDFvision","ZDFinfo","dvbc",394000,6900,"256qam",0,0,"P600:610:630:620:621:622:625","A620:621:622:625" +"ZDFvision","zdf_neo","dvbc",394000,6900,"256qam",0,0,"P650:660:680:670:671:672:675","A670:671:672:675" +"ZDFvision","zdf.kultur","dvbc",394000,6900,"256qam",0,0,"P1100:1110:1130:1120:1121:1122:1125","A1120:1121:1122:1125" +"Unitymedia","Lig TV","dvbc",402000,6900,"256qam",0,0,"P261:553","A" +"Unitymedia","Turkmax","dvbc",402000,6900,"256qam",0,0,"P266:603","A" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P269:633:635:634:2241:2242:2243","A634:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P270:633:635:644:2241:2242:2243","A644:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P271:633:635:654:2241:2242:2243","A654:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P272:633:635:664:2241:2242:2243","A664:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P273:633:635:674:2241:2242:2243","A674:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P274:633:635:684:2241:2242:2243","A684:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P275:633:635:694:2241:2242:2243","A694:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P279:633:635:734:2241:2242:2243","A734:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P280:633:635:744:2241:2242:2243","A744:2241:2242:2243" +"Unitymedia","euronews","dvbc",402000,6900,"256qam",0,0,"P281:633:635:754:2241:2242:2243","A754:2241:2242:2243" +"ARD","Das Erste","dvbc",410000,6900,"256qam",0,0,"P100:101:104:102:103:106","A102:103:106" +"ARD","Bayerisches FS Süd","dvbc",410000,6900,"256qam",0,0,"P200:201:204:202:203:206","A202:203:206" +"ARD","hr-fernsehen","dvbc",410000,6900,"256qam",0,0,"P300:301:304:302:303","A302:303" +"ARD","Bayerisches FS Nord","dvbc",410000,6900,"256qam",0,0,"P500:201:204:202:203:206","A202:203:206" +"ARD","WDR Köln","dvbc",410000,6900,"256qam",0,0,"P600:601:604:602:603","A602:603" +"ARD","SWR Fernsehen BW","dvbc",410000,6900,"256qam",0,0,"P800:801:804:802:803:806","A802:803:806" +"ARD","Das Erste HD","dvbc",418000,6900,"256qam",0,0,"P6000:6010:6030:6020:6021:6022","A6020:6021:6022" +"ARD","BR-alpha","dvbc",418000,6900,"256qam",0,0,"P1400:1401:1404:1402:1403:1406","A1402:1403:1406" +"ARD","tagesschau24","dvbc",418000,6900,"256qam",0,0,"P100:101:104:102","A102" +"ARD","Einsfestival","dvbc",418000,6900,"256qam",0,0,"P200:201:204:202:203:206","A202:203:206" +"ARD","EinsPlus","dvbc",418000,6900,"256qam",0,0,"P300:301:304:302:303:306","A302:303:306" +"ARD","arte","dvbc",418000,6900,"256qam",0,0,"P400:401:404:402:403","A402:403" +"ARD","PHOENIX","dvbc",418000,6900,"256qam",0,0,"P500:501:504:502:503","A502:503" +"ARD","rbb Brandenburg","dvbc",426000,6900,"256qam",0,0,"P500:601:604:602:603","A602:603" +"ARD","rbb Berlin","dvbc",426000,6900,"256qam",0,0,"P600:601:604:602:603","A602:603" +"ARD","NDR FS MV","dvbc",426000,6900,"256qam",0,0,"P2400:2601:2604:2602:2603","A2602:2603" +"ARD","NDR FS HH","dvbc",426000,6900,"256qam",0,0,"P2500:2601:2604:2602:2603","A2602:2603" +"ARD","NDR FS NDS","dvbc",426000,6900,"256qam",0,0,"P2600:2601:2604:2602:2603","A2602:2603" +"ARD","NDR FS SH","dvbc",426000,6900,"256qam",0,0,"P2700:2601:2604:2602:2603","A2602:2603" +"ARD","MDR Sachsen","dvbc",426000,6900,"256qam",0,0,"P2800:2901:2904:2902:2903","A2902:2903" +"ARD","MDR S-Anhalt","dvbc",426000,6900,"256qam",0,0,"P2900:2901:2904:2902:2903","A2902:2903" +"ARD","MDR Thüringen","dvbc",426000,6900,"256qam",0,0,"P3000:2901:2904:2902:2903","A2902:2903" +"ARD","SWR Fernsehen RP","dvbc",426000,6900,"256qam",0,0,"P3100:3101:3104:3102:3103:3106","A3102:3103:3106" +"Unitymedia","TRT Türk","dvbc",434000,6900,"256qam",0,0,"P268:623:626:625:624","A624" +"Unitymedia","RTL Television","dvbc",442000,6900,"256qam",0,0,"P258:523:528:524:525","A524:525" +"Unitymedia","SAT.1","dvbc",442000,6900,"256qam",0,0,"P259:533:538:534:536","A534:536" +"Unitymedia","ProSieben","dvbc",442000,6900,"256qam",0,0,"P260:543:548:544:545","A544:545" +"Unitymedia","VOX","dvbc",442000,6900,"256qam",0,0,"P261:553:558:554","A554" +"Unitymedia","RTL2","dvbc",442000,6900,"256qam",0,0,"P262:563:568:564","A564" +"Unitymedia","kabel eins","dvbc",442000,6900,"256qam",0,0,"P263:573:578:574","A574" +"Unitymedia","Super RTL","dvbc",442000,6900,"256qam",0,0,"P265:583:588:584","A584" +"Unitymedia","n-tv","dvbc",442000,6900,"256qam",0,0,"P266:593:598:594","A594" +"Unitymedia","N24","dvbc",442000,6900,"256qam",0,0,"P267:603:608:604","A604" +"Unitymedia","DAS VIERTE","dvbc",450000,6900,"256qam",0,0,"P257:513:518:514","A514" +"Unitymedia","Nick/Comedy Central","dvbc",450000,6900,"256qam",0,0,"P259:533:539:538:534","A534" +"Unitymedia","EUROSPORT","dvbc",450000,6900,"256qam",0,0,"P260:543:548:544","A544" +"Unitymedia","SPORT1","dvbc",450000,6900,"256qam",0,0,"P278:723:728:724","A724" +"Unitymedia","Tele 5","dvbc",450000,6900,"256qam",0,0,"P279:733:738:734","A734" +"Unitymedia","Bibel TV","dvbc",466000,6900,"256qam",0,0,"P266:603:606:604","A604" +"Unitymedia","K-TV","dvbc",466000,6900,"256qam",0,0,"P261:553:558:554","A554" +"Unitymedia","Servus TV","dvbc",522000,6900,"256qam",0,0,"P262:563:568:564","A564" +"Unitymedia","HSE24 TREND","dvbc",522000,6900,"256qam",0,0,"P261:553:558:554","A554" +"Unitymedia","QVC Plus","dvbc",522000,6900,"256qam",0,0,"P257:513:518:514","A514" +"Unitymedia","iM1","dvbc",522000,6900,"256qam",0,0,"P258:523:524","A524" +"Unitymedia","Juwelo","dvbc",522000,6900,"256qam",0,0,"P259:533:534","A534" +"Unitymedia","QVC","dvbc",522000,6900,"256qam",0,0,"P263:573:578:574","A574" +"Unitymedia","HSE24","dvbc",522000,6900,"256qam",0,0,"P264:583:588:584","A584" +"Unitymedia","DELUXE MUSIC","dvbc",522000,6900,"256qam",0,0,"P260:543:544","A544" +"Unitymedia","HSE24 EXTRA","dvbc",522000,6900,"256qam",0,0,"P265:593:598:594","A594" +"Unitymedia","QVC Beauty","dvbc",522000,6900,"256qam",0,0,"P267:613:618:614","A614" +"Unitymedia","SIXX","dvbc",530000,6900,"256qam",0,0,"P263:573:578:574","A574" +"Unitymedia","Viva","dvbc",530000,6900,"256qam",0,0,"P257:513:519:518:514","A514" +"Unitymedia","Channel21","dvbc",530000,6900,"256qam",0,0,"P258:523:528:524","A524" +"Unitymedia","1-2-3.tv","dvbc",530000,6900,"256qam",0,0,"P259:533:538:534","A534" +"Unitymedia","DMAX","dvbc",530000,6900,"256qam",0,0,"P260:543:548:544","A544" +"Unitymedia","CNN","dvbc",530000,6900,"256qam",0,0,"P261:553:554","A554" +"Unitymedia","sonnenklar.TV","dvbc",530000,6900,"256qam",0,0,"P262:563:568:564","A564" +"Unitymedia","TV5MONDE Europe","dvbc",530000,6900,"256qam",0,0,"P264:583:588:584","A584" +"Unitymedia","SAT.1 Gold","dvbc",530000,6900,"256qam",0,0,"P266:603:608:604","A604" +"Unitymedia","RTL NITRO","dvbc",530000,6900,"256qam",0,0,"P267:613:618:614","A614" +"Unitymedia","SonLife","dvbc",538000,6900,"256qam",0,0,"P268:623:624","A624" +"Unitymedia","CCTV9","dvbc",538000,6900,"256qam",0,0,"P266:603:604","A604" +"Unitymedia","SKY News","dvbc",538000,6900,"256qam",0,0,"P264:583:584","A584" +"Unitymedia","Astro TV","dvbc",546000,6900,"256qam",0,0,"P268:623:628:624","A624" +"Unitymedia","joiz","dvbc",554000,6900,"256qam",0,0,"P257:513:514","A514" +"Unitymedia","Bloomberg","dvbc",554000,6900,"256qam",0,0,"P266:603:604","A604" +"Unitymedia","BBC World News","dvbc",570000,6900,"256qam",0,0,"P257:513:514","A514" +"Unitymedia","France 24","dvbc",570000,6900,"256qam",0,0,"P259:533:534","A534" +"Unitymedia","Al Jazeera International","dvbc",570000,6900,"256qam",0,0,"P260:543:544","A544" +"Unitymedia","Russia Today","dvbc",570000,6900,"256qam",0,0,"P261:553:554","A554" +"Unitymedia","CCTV News","dvbc",570000,6900,"256qam",0,0,"P262:563:564","A564" +"Unitymedia","Unitymedia Videothek","dvbc",610000,6900,"256qam",0,0,"P257:513:514","A514" +"Unitymedia","Mehr Programm","dvbc",610000,6900,"256qam",0,0,"P259:515","A" +"Unitymedia","Programm 25110","dvbc",746000,6900,"256qam",0,0,"P257:513","A" +"ARD","arte HD","dvbc",762000,6900,"64qam",0,0,"P257:513:518:514:515:516","A514:515:516" +"Unitymedia","ServusTV HD","dvbc",762000,6900,"64qam",0,0,"P258:523:528:524:525:526","A524:525:526" +"Unitymedia","QVC HD","dvbc",762000,6900,"64qam",0,0,"P259:533:538:534","A534" +"Unitymedia","HSE24 HD","dvbc",762000,6900,"64qam",0,0,"P260:543:548:544","A544" diff --git a/octoserve/var/dms/ConnectionManager.lua b/octoserve/var/dms/ConnectionManager.lua new file mode 100644 index 0000000..bb5e1b5 --- /dev/null +++ b/octoserve/var/dms/ConnectionManager.lua @@ -0,0 +1,90 @@ + +ConnectionManager = {} + +function ConnectionManager:Description() + t = "" + local f = io.open("ConnectionManager.xml","r") + if not f then os.exit() end + while true do + local line = f:read() + if not line then break end + t = t .. line .. "\r\n" + end + f:close() + return t +end + +local dlnaprofile = 'DLNA.ORG_PN=MPEG_TS;DLNA.ORG_OP=00;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000' +local dlnaschema = ' xmlns:dlna="urn:schemas-dlna-org:metadata-1-0"' + +if DisableDLNA then + dlnaprofile = '*' + dlnaschema = '' +end + +local Schema = 'xmlns:u="urn:schemas-upnp-org:service:ConnectionManager:1"' + + +local ProtocolInfo = 'rtsp-rtp-udp:*:video/mp2t:'..dlnaprofile + .. ','..'rtsp-rtp-udp:*:audio/mp2t:'..dlnaprofile + -- ','..'http-get:*:video/x-ms-wmv:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000' -- TEST + + +function ConnectionManager:Invoke(client,Attributes,Request) + local Action = string.match(Attributes["SOAPACTION"],".+%#([%a%d%-_]+)") + local Host = tostring(Attributes["host"]) + + print(Host,"ConnectionManager",Action) + + if Action == "GetProtocolInfo" then + UPnP:SendResponse(client,UPnP:CreateResponse(Schema,Action,{{ n = "Source", v = ProtocolInfo }, { n = "Sink", v = "" }})) + elseif Action == "GetCurrentConnectionIDs" then + UPnP:SendResponse(client,UPnP:CreateResponse(Schema,Action,{{ n = "ConnectionIDs", v = "0" }})) + elseif Action == "GetCurrentConnectionInfo" then + UPnP:SendSoapError(client,706) + else + UPnP:SendSoapError(client,401) + end + return +end + + +function ConnectionManager:Subscribe(client,callback,timeout) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Server: "..UPnP.Server.."\r\n" + .. "SID: uuid:50c95801-e839-4b96-b7ae-779d989e1399\r\n" + .. "Timeout: Second-1800\r\n" + .. "Content-Length: 0\r\n" + .. "Connection: close\r\n" + .. "EXT:\r\n" + .. "\r\n" + client:send(r) + + local ipaddr,port = client:getpeername() + local Args = { { n = "SourceProtocolInfo", v = ProtocolInfo }, { n = "SourceProtocolInfo", v = "" }, { n = "CurrentConnectionIDs", v = "0" } } + UPnP:SendEvent(callback,"50c95801-e839-4b96-b7ae-779d989e1399",0,Args) +end + +function ConnectionManager:Renew(client,sid,timeout) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Server: "..UPnP.Server.."\r\n" + .. "SID: uuid:50c95801-e839-4b96-b7ae-779d989e1399\r\n" + .. "Timeout: Second-1800\r\n" + .. "Content-Length: 0\r\n" + .. "Connection: close\r\n" + .. "EXT:\r\n" + .. "\r\n" + client:send(r) +end + +function ConnectionManager:Unsubscribe(client,sid) + local r = "HTTP/1.1 200 OK\r\n" + .. "Server: "..UPnP.Server.."\r\n" + .. "Connection: close\r\n" + .. "\r\n" + client:send(r) +end + +return ConnectionManager \ No newline at end of file diff --git a/octoserve/var/dms/ConnectionManager.xml b/octoserve/var/dms/ConnectionManager.xml new file mode 100644 index 0000000..05905ba --- /dev/null +++ b/octoserve/var/dms/ConnectionManager.xml @@ -0,0 +1,134 @@ + + + +1 +0 + + + + GetProtocolInfo + + + Source + out + SourceProtocolInfo + + + Sink + out + SinkProtocolInfo + + + + + GetCurrentConnectionIDs + + + ConnectionIDs + out + CurrentConnectionIDs + + + + + GetCurrentConnectionInfo + + + ConnectionID + in + A_ARG_TYPE_ConnectionID + + + RcsID + out + A_ARG_TYPE_RcsID + + + AVTransportID + out + A_ARG_TYPE_AVTransportID + + + ProtocolInfo + out + A_ARG_TYPE_ProtocolInfo + + + PeerConnectionManager + out + A_ARG_TYPE_ConnectionManager + + + PeerConnectionID + out + A_ARG_TYPE_ConnectionID + + + Direction + out + A_ARG_TYPE_Direction + + + Status + out + A_ARG_TYPE_ConnectionStatus + + + + + + + + SourceProtocolInfo + string + + + SinkProtocolInfo + string + + + CurrentConnectionIDs + string + + + A_ARG_TYPE_ConnectionStatus + string + + OK + ContentFormatMismatch + InsufficientBandwidth + UnreliableChannel + Unknown + + + + A_ARG_TYPE_ConnectionManager + string + + + A_ARG_TYPE_Direction + string + + Input + Output + + + + A_ARG_TYPE_ProtocolInfo + string + + + A_ARG_TYPE_ConnectionID + i4 + + + A_ARG_TYPE_AVTransportID + i4 + + + A_ARG_TYPE_RcsID + i4 + + + + \ No newline at end of file diff --git a/octoserve/var/dms/ContentDirectory.lua b/octoserve/var/dms/ContentDirectory.lua new file mode 100644 index 0000000..a5cf6fc --- /dev/null +++ b/octoserve/var/dms/ContentDirectory.lua @@ -0,0 +1,422 @@ + + +local ContentDirectory = {} + +local db = require("DataBase") + +-- local dlnaprofile = 'DLNA.ORG_PN=MPEG_TS;DLNA.ORG_OP=00;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=0D100000000000000000000000000000' +local dlnaprofile = 'DLNA.ORG_PN=MPEG_TS;DLNA.ORG_OP=00;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=8D100000000000000000000000000000' +local dlnaschema = ' xmlns:dlna="urn:schemas-dlna-org:metadata-1-0"' + +if DisableDLNA then + dlnaprofile = '*' + dlnaschema = '' +end + +local Schema = 'xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"' + +local DIDLStart = '' -- '<?xml version="1.0" encoding="utf-8"?>' + ..'<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/"' + ..' xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"' + ..' xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"' + -- .. dlnaschema + ..'>' +local DIDLEnd = '</DIDL-Lite>' + +-- State variables +local SystemUpdateID = 36 +-- --------------- +---------------------------------------------------------------------------------------------------------------------------------------- + +local AllFolders = {} +local RootFolders = {} +local Folders = {} +local AllItems = {} + +local i,f,vi,ai + +----- Hierarchical Folders + +RootFolders[#RootFolders+1] = { title = "All", id = "64" } +RootFolders[#RootFolders+1] = { title = "Audio", id = "1" } +RootFolders[#RootFolders+1] = { title = "Images", id = "3" } +RootFolders[#RootFolders+1] = { title = "Video", id = "2" } +for _,f in ipairs(RootFolders) do + f.VideoItems = {} + f.AudioItems = {} + f.ChildFolders = {} + AllFolders[f.id] = f +end +AllFolders["2"].ChildFolders = Folders +AllFolders["64"].ChildFolders = Folders + +---- + +for _,f in ipairs(db.SourceList) do + f.id = f.refid + f.VideoItems = {} + f.AudioItems = {} + f.ChildFolders = {} + table.insert(Folders,f) +-- table.insert(RootFolders,f) + AllFolders[f.id] = f +end + +for _,vi in ipairs(db.ChannelList) do + f = AllFolders[vi.refid] + vi.id = f.id.."$"..tostring(#f.VideoItems) + vi.src = f.src + vi.parentID = f.id + vi.request = string.gsub(vi.request,'&','&amp;') + vi.title = string.gsub(vi.title,'&','&amp;') + vi.title = string.gsub(vi.title,'<','&lt;') + vi.title = string.gsub(vi.title,'>','&gt;') + table.insert(f.VideoItems,vi) + AllItems[vi.id] = vi +end + +----- Add Stream Folder + +f = {} +f.id = "STRM" +f.title = "Current Streams" +f.VideoItems = {} +f.AudioItems = {} +f.ChildFolders = {} +table.insert(Folders,f) +AllFolders[f.id] = f +for i = 1,4,1 do + vi = { id = f.id.."$"..tostring(i-1), parentID = f.id, title = "Stream "..tostring(i), stream = tostring(i) } + table.insert(f.VideoItems,vi) + AllItems[vi.id] = vi +end + +---------------------------------------------------------------------------------------------------------------------------------------- + +local function Folder(title,id,parentid,childCount) + local F = '<container id="'..id..'" parentID="'..parentid..'"' + -- ..' childCount="'..childCount..'"' + ..' restricted="1"' + -- ..' searchable="1"' + ..'>' + ..'<dc:title>'..title..'</dc:title>' + ..'<upnp:class>object.container.storageFolder</upnp:class>' + ..'</container>' + return F +end + +local function VideoItem(Host,Item,nCompat) + local rtspreq = '' + if Item.stream then + rtspreq = 'stream='..Item.stream + else + -- Some clients don't like a long request url, or an url with '&' in it + -- Fail them for now + -- if nCompat then + -- rtspreq = "stream_99" + -- elseif Item.src then + if Item.src then + rtspreq = '?src='..Item.src..'&amp;'..Item.request + else + rtspreq = '?'..Item.request + end + end + + local didl = '<item id="'..Item.id..'" parentID="'..Item.parentID + didl = didl .. '" restricted="1">' + ..'<dc:title>'..Item.title..'</dc:title>' + ..'<upnp:class>object.item.videoItem.videoBroadcast</upnp:class>' + if Item.channelNr then + didl = didl ..'<upnp:channelNr>'..Item.channelNr..'</upnp:channelNr>' + end + didl = didl ..'<res' + ..' protocolInfo="rtsp-rtp-udp:*:video/mpeg:'..dlnaprofile..'">' + ..'rtsp://'..Host..':554/'..rtspreq + ..'</res>' + didl = didl ..'</item>' + return didl + +end + + +local function BrowseChildren(client,Host,Request,nCompat) + local ObjectID = UPnP:GetRequestParam(Request,"ObjectID") + local BrowseFlag = UPnP:GetRequestParam(Request,"BrowseFlag") + local Filter = UPnP:GetRequestParam(Request,"Filter") + local StartingIndex = tonumber(UPnP:GetRequestParam(Request,"StartingIndex")) + local RequestedCount = tonumber(UPnP:GetRequestParam(Request,"RequestedCount")) + print("BrowseChildren",ObjectID,Filter,StartingIndex,RequestedCount) + + local didl = DIDLStart; + local Error = 0 + local NumberReturned = 0 + local TotalMatches = 0 + local UpdateID = SystemUpdateID + local f,vi,ai + + if ObjectID == "0" then + if nCompat then + for _,f in ipairs(RootFolders) do + didl = didl..Folder(f.title,f.id,ObjectID,tostring(#f.VideoItems + #f.AudioItems + #f.ChildFolders)) + NumberReturned = NumberReturned + 1 + TotalMatches = TotalMatches +1 + end + else + for _,f in ipairs(Folders) do + didl = didl..Folder(f.title,f.id,ObjectID,tostring(#f.VideoItems + #f.AudioItems + #f.ChildFolders)) + NumberReturned = NumberReturned + 1 + TotalMatches = TotalMatches +1 + end + end + + else + local f = AllFolders[ObjectID] + if f then + + local Index = 0 + for i,cf in ipairs(f.ChildFolders) do + if Index >= StartingIndex and (RequestedCount == 0 or NumberReturned < RequestedCount) then + didl = didl..Folder(cf.title,cf.id,ObjectID,tostring(#cf.VideoItems + #cf.AudioItems + #cf.ChildFolders)) + NumberReturned = NumberReturned + 1 + end + Index = Index + 1 + TotalMatches = TotalMatches +1 + end + + for i,vi in ipairs(f.VideoItems) do + if Index >= StartingIndex and (RequestedCount == 0 or NumberReturned < RequestedCount) then + didl = didl..VideoItem(Host,vi,nCompat) + NumberReturned = NumberReturned + 1 + end + Index = Index + 1 + TotalMatches = TotalMatches +1 + end + + else + Error = 710 + end + end + + didl = didl..DIDLEnd + print("Returned",StartingIndex,NumberReturned,TotalMatches,Error) + + if Error == 0 then + local Args = { { n = "Result", v = didl }, { n = "NumberReturned", v = tostring(NumberReturned)}, + { n = "TotalMatches", v = tostring(TotalMatches)}, { n = "UpdateID", v = tostring(UpdateID) } } + UPnP:SendResponse(client,UPnP:CreateResponse(Schema,"Browse",Args)) + else + UPnP:SendSoapError(client,Error) + end + + return +end + +local function BrowseMetaData(client,Host,Request,nCompat) + local ObjectID = UPnP:GetRequestParam(Request,"ObjectID") + local didl = DIDLStart; + local UpdateID = SystemUpdateID + local Error = 0 + + if ObjectID == "0" then + local ChildCount = #Folders + if nCompat then ChildCount = #RootFolders end + didl = didl .. '<container id="1" parentID = "-1" childCount="'..tostring(ChildCount)..'" restricted="true">>' + .. '<:dc:title>OctopusNet</dc:title>' + ..'<upnp:class>object.container.storageFolder</upnp:class>' + ..'</container>' + else + local f = AllFolders[ObjectID] + if f then + didl = didl..Folder(f.title,f.id,ObjectID,tostring(#f.VideoItems + #f.AudioItems + #f.ChildFolders)) + else + local item = AllItems[ObjectID] + if item then + didl = didl..VideoItem(Host,item,nCompat) + else + Error = 710 + end + end + end + + didl = didl..DIDLEnd + + if Error == 0 then + local Args = { { n = "Result", v = didl }, { n = "NumberReturned", v = "1"}, + { n = "TotalMatches", v = "1"}, { n = "UpdateID", v = tostring(UpdateID) } } + UPnP:SendResponse(client,UPnP:CreateResponse(Schema,"Browse",Args)) + else + UPnP:SendSoapError(client,Error) + end + + didl = DIDLEnd; +end + +local function Search(client,Host,Request,nCompat) + local ContainerID = UPnP:GetRequestParam(Request,"ContainerID") + local SearchCriteria = UPnP:GetRequestParam(Request,"SearchCriteria") + local Filter = UPnP:GetRequestParam(Request,"Filter") + local StartingIndex = tonumber(UPnP:GetRequestParam(Request,"StartingIndex")) + local RequestedCount = tonumber(UPnP:GetRequestParam(Request,"RequestedCount")) + local SortCriteria = UPnP:GetRequestParam(Request,"SortCriteria") + print(SearchCriteria,ContainerID,Filter,StartingIndex,RequestedCount,SortCriteria) + + local didl = DIDLStart; + local Error = 0 + local NumberReturned = 0 + local TotalMatches = 0 + local UpdateID = SystemUpdateID + + if string.match(SearchCriteria,"videoItem") then + + if ContainerID == "0" then + if not nCompat or nCompat ~= "WMP" then + local Index = 0 + for _,vi in pairs(AllItems) do + if Index >= StartingIndex and (RequestedCount == 0 or NumberReturned < RequestedCount) then + didl = didl..VideoItem(Host,vi,nCompat) + NumberReturned = NumberReturned + 1 + end + Index = Index + 1 + TotalMatches = TotalMatches + 1 + -- if nCompat and TotalMatches > 19 then break end + end + end + + else + local f = AllFolders[ContainerID] + if f then + local src = f.src + if src then src = "src="..src.."&" else src = "" end + + local Index = 0 + for _,vi in ipairs(f.VideoItems) do + if Index >= StartingIndex and (RequestedCount == 0 or NumberReturned < RequestedCount) then + didl = didl..VideoItem(Host,vi,nCompat) + NumberReturned = NumberReturned + 1 + end + Index = Index + 1 + TotalMatches = TotalMatches +1 + end + else + Error = 710 + end + end + end + + didl = didl..DIDLEnd + -- didl = TestDidl + -- NumberReturned = 1 + -- TotalMatches = 1 + print("Returned",StartingIndex,NumberReturned,TotalMatches,Error) + + + if Error == 0 then + local Args = { { n = "Result", v = didl }, { n = "NumberReturned", v = tostring(NumberReturned)}, + { n = "TotalMatches", v = tostring(TotalMatches)}, { n = "UpdateID", v = tostring(UpdateID) } } + UPnP:SendResponse(client,UPnP:CreateResponse(Schema,"Search",Args)) + else + UPnP:SendSoapError(client,Error) + end + + return +end + +local function SendResult(client,Action,VarName,Result) + local Args = { { n = VarName, v = Result } } + UPnP:SendResponse(client,UPnP:CreateResponse(Schema,Action,Args)) +end + +function ContentDirectory:Invoke(client,Attributes,Request) + local Action = string.match(Attributes["SOAPACTION"],".+%#([%a%d%-_]+)") + local Host = tostring(Attributes["host"]) + + local Compability = nil + if Attributes["USER-AGENT"] then + if string.match(Attributes["USER-AGENT"],"Windows%-Media%-Player") then Compability = "WMP" + elseif string.match(Attributes["USER-AGENT"],"IPI%/1%.0") then Compability = "IPI" + end + end + print("Compability=",Compability) + + print(Host,"ContentDirectory",Action) + if Action == "Browse" then + local BrowseFlag = tostring(UPnP:GetRequestParam(Request,"BrowseFlag")) + if BrowseFlag == "BrowseDirectChildren" then + BrowseChildren(client,Host,Request,Compability) + elseif BrowseFlag == "BrowseMetadata" then + BrowseMetaData(client,Host,Request,Compability) + else + UPnP:SendSoapError(client,710) + end + elseif Action == "Search" then + Search(client,Host,Request,Compability) + -- elseif Action == "X_GetRemoteSharingStatus" then + -- SendResult(client,Action,"0") + elseif Action == "GetSortCapabilities" then + SendResult(client,Action,"SortCaps","dc:title,upnp:class,upnp:originalTrackNumber") + elseif Action == "GetSearchCapabilities" then + SendResult(client,Action,"SearchCaps","dc:title") + elseif Action == "GetSystemUpdateID" then + SendResult(client,Action,"Id","1") + else + UPnP:SendSoapError(client,401) + end +end + +function ContentDirectory:Subscribe(client,callback,timeout) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Server: "..UPnP.Server.."\r\n" + .. "SID: uuid:50c95800-e839-4b96-b7ae-779d989e1399\r\n" + .. "Timeout: Second-1800\r\n" + .. "Content-Length: 0\r\n" + .. "Connection: close\r\n" + .. "EXT:\r\n" + .. "\r\n" + client:send(r) + + local ipaddr,port = client:getpeername() + local Args = { { n = "TransferIDs", v = "" }, { n = "SystemUpdateID", v = tostring(SystemUpdateID) } } + UPnP:SendEvent(callback,"50c95800-e839-4b96-b7ae-779d989e1399",0,Args) + +end + +function ContentDirectory:Renew(client,sid,timeout) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Server: "..UPnP.Server.."\r\n" + .. "SID: uuid:50c95800-e839-4b96-b7ae-779d989e1399\r\n" + .. "Timeout: Second-1800\r\n" + .. "Content-Length: 0\r\n" + .. "Connection: close\r\n" + .. "EXT:\r\n" + .. "\r\n" + client:send(r) +end + +function ContentDirectory:Unsubscribe(client,sid) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Server: "..UPnP.Server.."\r\n" + .. "Content-Length: 0\r\n" + .. "Connection: close\r\n" + .. "EXT:\r\n" + .. "\r\n" + client:send(r) +end + + +function ContentDirectory:Description() + t = "" + local f = io.open("ContentDirectory.xml","r") + if not f then os.exit() end + while true do + local line = f:read() + if not line then break end + t = t .. line .. "\r\n" + end + f:close() + return t +end + +return ContentDirectory \ No newline at end of file diff --git a/octoserve/var/dms/ContentDirectory.xml b/octoserve/var/dms/ContentDirectory.xml new file mode 100644 index 0000000..c353b92 --- /dev/null +++ b/octoserve/var/dms/ContentDirectory.xml @@ -0,0 +1,207 @@ + + + + 1 + 0 + + + + GetSearchCapabilities + + + SearchCaps + out + SearchCapabilities + + + + + GetSortCapabilities + + + SortCaps + out + SortCapabilities + + + + + GetSystemUpdateID + + + Id + out + SystemUpdateID + + + + + Browse + + + ObjectID + in + A_ARG_TYPE_ObjectID + + + BrowseFlag + in + A_ARG_TYPE_BrowseFlag + + + Filter + in + A_ARG_TYPE_Filter + + + StartingIndex + in + A_ARG_TYPE_Index + + + RequestedCount + in + A_ARG_TYPE_Count + + + SortCriteria + in + A_ARG_TYPE_SortCriteria + + + Result + out + A_ARG_TYPE_Result + + + NumberReturned + out + A_ARG_TYPE_Count + + + TotalMatches + out + A_ARG_TYPE_Count + + + UpdateID + out + A_ARG_TYPE_UpdateID + + + + + Search + + + ContainerID + in + A_ARG_TYPE_ObjectID + + + SearchCriteria + in + A_ARG_TYPE_SearchCriteria + + + Filter + in + A_ARG_TYPE_Filter + + + StartingIndex + in + A_ARG_TYPE_Index + + + RequestedCount + in + A_ARG_TYPE_Count + + + SortCriteria + in + A_ARG_TYPE_SortCriteria + + + Result + out + A_ARG_TYPE_Result + + + NumberReturned + out + A_ARG_TYPE_Count + + + TotalMatches + out + A_ARG_TYPE_Count + + + UpdateID + out + A_ARG_TYPE_UpdateID + + + + + + + TransferIDs + string + + + A_ARG_TYPE_ObjectID + string + + + A_ARG_TYPE_Result + string + + + A_ARG_TYPE_SearchCriteria + string + + + A_ARG_TYPE_BrowseFlag + string + + BrowseMetadata + BrowseDirectChildren + + + + A_ARG_TYPE_Filter + string + + + A_ARG_TYPE_SortCriteria + string + + + A_ARG_TYPE_Index + ui4 + + + A_ARG_TYPE_Count + ui4 + + + A_ARG_TYPE_UpdateID + ui4 + + + SearchCapabilities + string + + + SortCapabilities + string + + + SystemUpdateID + ui4 + + + \ No newline at end of file diff --git a/octoserve/var/dms/MediaReceiverRegistrar.lua b/octoserve/var/dms/MediaReceiverRegistrar.lua new file mode 100644 index 0000000..15bbc7c --- /dev/null +++ b/octoserve/var/dms/MediaReceiverRegistrar.lua @@ -0,0 +1,80 @@ + +MediaReceiverRegistrar = {} + +function MediaReceiverRegistrar:Description() + t = "" + local f = io.open("MediaReceiverRegistrar.xml","r") + if not f then os.exit() end + while true do + local line = f:read() + if not line then break end + t = t .. line .. "\r\n" + end + f:close() + return t +end + +local function SendResult(client,Action,Result) + local Args = { { n = "Result", v = Result } } + UPnP:SendResponse(client,UPnP:CreateResponse('xmlns:u="urn:microsoft-com:service:X_MS_MediaReceiverRegistrar:1"',Action,Args)) +end + + +function MediaReceiverRegistrar:Invoke(client,Attributes,Request) + local Action = string.match(Attributes["SOAPACTION"],".+%#(%a+)") + print("MediaReceiverRegistrar",Action) + if Action == "IsAuthorized" then + SendResult(client,Action,"1") + -- UPnP:SendSoapError(client,402) + elseif Action == "IsValidated" then + SendResult(client,Action,"1") + else + UPnP:SendSoapError(client,401) + end + return +end + + + + +function MediaReceiverRegistrar:Subscribe(client,callback,timeout) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Server: "..UPnP.Server.."\r\n" + .. "SID: uuid:50c95802-e839-4b96-b7ae-779d989e1399\r\n" + .. "Timeout: Second-1800\r\n" + .. "Content-Length: 0\r\n" + .. "Connection: close\r\n" + .. "EXT:\r\n" + .. "\r\n" + client:send(r) + + local ipaddr,port = client:getpeername() + UPnP:SendEvent(callback,"50c95802-e839-4b96-b7ae-779d989e1399",0,{} ) +end + +function MediaReceiverRegistrar:Renew(client,sid,timeout) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Server: "..UPnP.Server.."\r\n" + .. "SID: uuid:50c95802-e839-4b96-b7ae-779d989e1399\r\n" + .. "Timeout: Second-1800\r\n" + .. "Content-Length: 0\r\n" + .. "Connection: close\r\n" + .. "EXT:\r\n" + .. "\r\n" + client:send(r) +end + +function MediaReceiverRegistrar:Unsubscribe(client,sid) + local r = "HTTP/1.1 200 OK\r\n" + .. "Server: "..UPnP.Server.."\r\n" + .. "Connection: close\r\n" + .. "\r\n" + client:send(r) +end + + + + +return MediaReceiverRegistrar \ No newline at end of file diff --git a/octoserve/var/dms/MediaReceiverRegistrar.xml b/octoserve/var/dms/MediaReceiverRegistrar.xml new file mode 100644 index 0000000..660a377 --- /dev/null +++ b/octoserve/var/dms/MediaReceiverRegistrar.xml @@ -0,0 +1,73 @@ + + + + 1 + 0 + + + + IsAuthorized + + + DeviceID + in + A_ARG_TYPE_DeviceID + + + Result + out + A_ARG_TYPE_Result + + + + + IsValidated + + + DeviceID + in + A_ARG_TYPE_DeviceID + + + Result + out + A_ARG_TYPE_Result + + + + + + + A_ARG_TYPE_DeviceID + string + + + A_ARG_TYPE_RegistrationReqMsg + bin.base64 + + + A_ARG_TYPE_RegistrationRespMsg + bin.base64 + + + A_ARG_TYPE_Result + int + + + AuthorizationDeniedUpdateID + ui4 + + + AuthorizationGrantedUpdateID + ui4 + + + ValidationRevokedUpdateID + ui4 + + + ValidationSucceededUpdateID + ui4 + + + \ No newline at end of file diff --git a/octoserve/var/dms/SendEvent.lua b/octoserve/var/dms/SendEvent.lua new file mode 100644 index 0000000..54a82c4 --- /dev/null +++ b/octoserve/var/dms/SendEvent.lua @@ -0,0 +1,68 @@ +#!/usr/bin/lua + +local socket = require("socket") +local mime = require("mime") +local url = require("socket.url") + +print(#arg) +if #arg ~= 4 then + os.exit(1) +end + +local path, uuid, seq, b64 = unpack(arg) + +print(path,uuid,seq) +print(b64) + +local values = mime.unb64(b64) +if values == "nil" then + values ="" +end + +local evnt = ''.."\r\n" + .. ''.."\r\n" + .. "\r\n" + .. values + .. "\r\n" + .. "\r\n" + +-- socket.sleep(0.5) + +for p in string.gmatch(path,"<(.+)>") do + + local parsed_url = url.parse(p) + print(parsed_url.host,parsed_url.port,parsed_url.path) + + local ip = parsed_url.host + local port = parsed_url.port + local path = parsed_url.path + + if port and port ~= "0" then + print("send ",ip,port,path) + + local r = "NOTIFY "..path.." HTTP/1.1\r\n" + .. "Host: "..ip..":"..port.."\r\n" + .. "Content-Type: text/xml; charset=\"utf-8\"\r\n" + .. "Content-Length: "..string.format("%d",#evnt).."\r\n" + .. "NT: upnp:event\r\n" + .. "NTS: upnp:propchange\r\n" + .. "SID: uuid:"..uuid.."\r\n" + .. "SEQ: "..seq.."\r\n" + .. "\r\n" + .. evnt + + tcp = socket.tcp() + tcp:settimeout(2) + + if tcp:connect(ip,port) then + + tcp:send(r) + tcp:receive("*l") + tcp:close() + + break + end + tcp:close() + end + +end \ No newline at end of file diff --git a/octoserve/var/dms/UPnP.lua b/octoserve/var/dms/UPnP.lua new file mode 100644 index 0000000..928eeb8 --- /dev/null +++ b/octoserve/var/dms/UPnP.lua @@ -0,0 +1,220 @@ + +UPnP = {} + +local DebugFlag = false +local Server = "Linux/3.9 DLNADOC/1.50 UPnP/1.0 OctopusNet-DMS/1.0" + +if DisableDLNA then + Server = "Linux/3.9 UPnP/1.0 OctopusNet-DMS/1.0" +end + +function UPnP:SetDebug(f) + DebugFlag = f +end + +UPnP.Server = Server + +function UPnP:ParseHTTPHeader(header) + local linenum = 0 + local method,path,proto + local attributes = {} + + for line in string.gmatch(header,"(.-)\r\n") do + if not line then break end + if DebugFlag then print(string.format("%2d:%s",linenum,line)) end + if linenum == 0 then + method,path,proto = string.match(line,"(.+)%s+(.+)%s+(.+)") + else + local n,v = string.match(line,"([%a%-]+)%s*%:%s*(.*)") + if n and v then + attributes[string.upper(n)] = v + end + end + + linenum = linenum + 1 + end + return method,path,proto,attributes +end + + +function UPnP:ReadHTTPHeader(client) + + local linenum = 0 + local line, err = client:receive() + + if err then + if DebugFlag then print("HTTPHeader Error "..err) end + return + end + + if DebugFlag then print(string.format("%2d:%s",linenum,line)) end + local method,path,proto = string.match(line,"(.+)%s+(.+)%s+(.+)") + local attributes = {} + + while true do + local line, err = client:receive() + if err then + if DebugFlag then print("HTTPHeader Error "..err.." HTTP Line: "..tostring(linenum)) end + return + end + linenum = linenum + 1 + if DebugFlag then print(string.format("%2d:%s",linenum,line)) end + if line == "" then break end + + if linenum == 30 then + if DebugFlag then print("HTTPHeader Error "..tostring(linenum)) end + return + end + + local n,v = string.match(line,"([%a%-]+)%s*%:%s*(.*)") + if n and v then + attributes[string.upper(n)] = v + end + + end + + -- Add some preparsed params, Note lower case key + if attributes["HOST"] then + local Host,Port = string.match(attributes["HOST"],"(.+)%:(%d+)") + attributes["host"] = Host + attributes["port"] = Port + end + + return method,path,proto,attributes +end + +function UPnP:ReadHTTPBody(client,clen) + local Body = "" + local linenum = 0 + + if DebugFlag and clen then print(string.format("---- Length = %d",clen)) end + + Body, err = client:receive(clen) + + if err then + if DebugFlag then print("HTTPBody Error "..err) end + return + end + -- while true do + -- local line, err = client:receive() + -- if err then + -- if DebugFlag then print("Error "..err) end + -- return + -- end + -- linenum = linenum + 1 + -- if DebugFlag then print(string.format("%4d:%s",linenum,line)) end + -- if line == "" then break end + + -- if linenum == 300 then + -- if DebugFlag then print("Error "..linenum) end + -- return + -- end + -- Body = Body .. line .. "\n" + -- end + return Body +end + +function UPnP:ParseInvocation(soap,Service) +end + +function UPnP:CreateResponse(Service,Action,Args) + local n,v + local soap = ''..'\r\n' + .. "" + .. "" + for _,a in ipairs(Args) do + soap = soap .. "<"..a.n..">"..a.v.."" + end + soap = soap .. ""..'\r\n' + return soap +end + +function UPnP:SendResponse(client,Content) + local r = "HTTP/1.1 200 OK\r\n" + .. "Content-Type: text/xml; charset=\"utf-8\"\r\n" + .. "Connection: close\r\n" + .. "Content-Length: "..string.format("%d",#Content).."\r\n" + .. "Server: "..Server.."\r\n" + .. "Date: "..os.date("!%a, %d %b %Y %H:%M:%S GMT").."\r\n" + .. "EXT:\r\n" + .. "\r\n" + .. Content + + client:send(r) +end + +function UPnP:GetRequestParam(Request,Param) + return string.match(Request,"%<"..Param..".*%>%s*(.+)%s*%<%/"..Param.."%>") +end + +local SoapErrorDescription = {} +SoapErrorDescription[402] = "Invalid Args" + +function UPnP:SendSoapError(client,code) + local soap = '' + .. "" + .. "" + .. "" + .. "s:Client" + .. "UPnPError" + .. "" + .. '' + .. ''..code..'' + .. ''..tostring(SoapErrorDescription[code])..'' + .. '' + .. "" + .. "" + .. "" + .. "" + + local r = "HTTP/1.1 500 Internal Server Error\r\n" + .. "Content-Type: text/xml; charset=\"utf-8\"\r\n" + .. "Connection: close\r\n" + .. "Content-Length: "..string.format("%d",#soap).."\r\n" + .. "Server: "..Server.."\r\n" + .. "Date: "..os.date("!%a, %d %b %Y %H:%M:%S GMT").."\r\n" + .. "EXT:\r\n" + .. "\r\n" + .. soap + + client:send(r) +end + +function UPnP:SendHTTPError(client,code) + local r = "HTTP/1.1 " ..code.."\r\n" + .. "Content-Type: text/html\r\n" + .. "Connection: Close\r\n" + .. "Server: "..UPnP.Server.."\r\n" + .. "Date: "..os.date("!%a, %d %b %Y %H:%M:%S GMT").."\r\n" + .. "\r\n" + .. "Error "..code.."

Error "..code.."

\r\n" + client:send(r) +end + +function UPnP:SendEvent(path,uuid,seq,values) + local xml = "" + for _,v in ipairs(values) do + xml = xml .. "<"..v.n..">"..v.v.."\r\n" + end + if xml == "" then xml="nil" end + + local b64 = mime.b64(xml) + os.execute('lua SendEvent.lua "'..path..'" "'..uuid..'" "'..seq..'" "'..b64..'"&') +end + +function UPnP:SystemParameters(template) + local ifconfig = io.popen("ifconfig eth0") + assert(ifconfig) + local eth0 = ifconfig:read("*a") + ifconfig:close() + + local myip = string.match(eth0,"inet addr%:(%d+%.%d+%.%d+%.%d+)") + local hwaddr = string.match(eth0,"HWaddr (%x+%:%x+%:%x+%:%x+%:%x+%:%x+)") + local guidend = string.gsub(hwaddr,"%:","") + local sernbr = tonumber(string.sub(guidend,-6),16) + local uuid = string.lower(string.gsub(template,"000000000000",guidend)) + + return uuid,sernbr,myip +end + +return UPnP \ No newline at end of file diff --git a/octoserve/var/dms/dms.lua b/octoserve/var/dms/dms.lua new file mode 100755 index 0000000..4c4e82e --- /dev/null +++ b/octoserve/var/dms/dms.lua @@ -0,0 +1,190 @@ +#!/usr/bin/lua + +local ClientTimeout = 20 +local Backlog = 32 +DisableDLNA = true + +local socket = require("socket") +local mime = require("mime") + +local upnp = require("UPnP") +local cman = require("ConnectionManager") +local cdir = require("ContentDirectory") +local mreg = require("MediaReceiverRegistrar") + + + + +function sendXMLFile(client,data) + local r = "HTTP/1.1 200 OK\r\n" + .. 'Content-Type: text/xml; charset="utf-8"\r\n' + .. "Connection: close\r\n" + .. "Content-Length: "..string.format("%d",#data).."\r\n" + .. "Server: "..UPnP.Server.."\r\n" + .. "Date: "..os.date("!%a, %d %b %Y %H:%M:%S GMT").."\r\n" + .. "EXT:\r\n" + .. "\r\n" + .. data + client:send(r) +end + +function sendImage(client,path) + local p = string.gsub(path,"%.+",".") + if string.sub(p,1,7) == "/icons/" then + local f = io.open("."..p,"r") + if f then + local image = f:read(100000) + f:close() + local t = "jpeg" + if p.sub(p,-3) == "png" then t = "png" end + + local r = "HTTP/1.1 200 OK\r\n" + .. "Content-Type: image/"..t.."\r\n" + .. "Content-Length: "..string.format("%d",#image).."\r\n" + .. "Connection: Close\r\n" + .. "Server: "..UPnP.Server.."\r\n" + .. "Date: "..os.date("!%a, %d %b %Y %H:%M:%S GMT").."\r\n" + .. "\r\n" + .. image + client:send(r) + else + upnp:SendHTTPError(client,404) + end + else + upnp:SendHTTPError(client,404) + end +end + +function sendRedirect(client,host) + local r = "HTTP/1.1 200 OK\r\n" + .. "Content-Type: text/html\r\n" + .. "Connection: Close\r\n" + .. "Server: "..UPnP.Server.."\r\n" + .. "Refresh: 0; url=http://"..host.."/\r\n" + .. "\r\n" + .. 'Click\r\n' + client:send(r) +end + +function LoadFile(fname) + print(fname) + t = "" + local f = io.open(fname,"r") + if not f then os.exit() end + while true do + local line = f:read() + if not line then break end + t = t .. line .. "\r\n" + end + f:close() + return t +end + +upnp:SetDebug(true) + +local port = 8080 +-- local RootLocation = "http://10.0.4.31:8080/dms.xml" + +local uuid,sernbr,myip = upnp:SystemParameters("f0287290-e1e1-11e2-9a21-000000000000") + +local Desc = LoadFile("dms.xml") +Desc = string.gsub(Desc,"##(%a+)##",{ UUID = uuid, SERNBR = sernbr, HOST = myip }) + +if DisableDLNA then + Desc = string.gsub(Desc,"(%)","") +end + +local server = socket.tcp() +assert(server:setoption("reuseaddr", true)) +assert(server:bind("*", port)) + +local ip, port = server:getsockname() +print("Listen: " .. ip .. ":" .. port) + +assert(server:listen(Backlog)) + +while true do + local client = server:accept() + client:settimeout(ClientTimeout) + + local method,path,proto,attributes = upnp:ReadHTTPHeader(client) + if method then + if method == "GET" then + if path == "/dms.xml" then + sendXMLFile(client,Desc) + elseif path == "/cman.xml" then + sendXMLFile(client,cman:Description()) + elseif path == "/cdir.xml" then + sendXMLFile(client,cdir:Description()) + elseif path == "/mreg.xml" then + sendXMLFile(client,mreg:Description()) + elseif path == "/" then + sendRedirect(client,attributes["host"]) + else + sendImage(client,path) + end + elseif method == "SUBSCRIBE" then + if attributes["NT"] then + if attributes["NT"] == "upnp:event" and attributes["CALLBACK"] ~= "" then + if path == "/cde" then + cdir:Subscribe(client,attributes["CALLBACK"],attributes["TIMEOUT"]) + elseif path == "/cme" then + cman:Subscribe(client,attributes["CALLBACK"],attributes["TIMEOUT"]) + elseif path == "/mre" then + mreg:Subscribe(client,attributes["CALLBACK"],attributes["TIMEOUT"]) + else + upnp:SendSoapError(client,401) + end + else + upnp:SendSoapError(client,412) + end + else + if attributes["SID"] and attributes["SID"] ~= "" then + if path == "/cde" then + cdir:Renew(client,attributes["SID"],attributes["TIMEOUT"]) + elseif path == "/cme" then + cman:Renew(client,attributes["SID"],attributes["TIMEOUT"]) + elseif path == "/mre" then + mreg:Renew(client,attributes["SID"],attributes["TIMEOUT"]) + else + upnp:SendSoapError(client,401) + end + else + upnp:SendSoapError(client,412) + end + end + elseif method == "UNSUBSCRIBE" then + if attributes["SID"] and attributes["SID"] ~= "" then + if path == "/cde" then + cdir:Unsubscribe(client,attributes["SID"]) + elseif path == "/cme" then + cman:Unsubscribe(client,attributes["SID"]) + elseif path == "/mre" then + mreg:Unsubscribe(client,attributes["SID"]) + else + upnp:SendSoapError(client,401) + end + else + upnp:SendSoapError(client,412) + end + elseif method == "POST" then + local soap = upnp:ReadHTTPBody(client,attributes["CONTENT-LENGTH"]) + + if path == "/cdc" then + cdir:Invoke(client,attributes,soap) + elseif path == "/cmc" then + cman:Invoke(client,attributes,soap) + elseif path == "/mrc" then + mreg:Invoke(client,attributes,soap) + else + upnp:SendSoapError(client,404) + end + else + upnp:SendHTTPError(client,"500") + end + end + + client:close() + collectgarbage() + +end diff --git a/octoserve/var/dms/dms.xml b/octoserve/var/dms/dms.xml new file mode 100644 index 0000000..1e45289 --- /dev/null +++ b/octoserve/var/dms/dms.xml @@ -0,0 +1,74 @@ + + + + 1 + 0 + + + urn:schemas-upnp-org:device:MediaServer:1 + OctopusNet DMS + Digital Devices GmbH + http://www.digitaldevices.de + OctopusNet + OctopusNet DMS + 1 + + ##SERNBR## + uuid:##UUID## + DMS-1.50 + + + image/png + 120 + 120 + 24 + icons/dd-120.png + + + image/jpg + 120 + 120 + 24 + icons/dd-120.jpg + + + image/png + 48 + 48 + 24 + icons/dd-48.png + + + image/jpg + 48 + 48 + 24 + icons/dd-48.jpg + + + + + urn:schemas-upnp-org:service:ContentDirectory:1 + urn:upnp-org:serviceId:ContentDirectory + /cdir.xml + /cdc + /cde + + + urn:schemas-upnp-org:service:ConnectionManager:1 + urn:upnp-org:serviceId:ConnectionManager + /cman.xml + /cmc + /cme + + + urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1 + urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar + /mreg.xml + /mrc + /mre + + + //##HOST##/ + + diff --git a/octoserve/var/dms/icons/dd-120.jpg b/octoserve/var/dms/icons/dd-120.jpg new file mode 100644 index 0000000..86bf2c7 Binary files /dev/null and b/octoserve/var/dms/icons/dd-120.jpg differ diff --git a/octoserve/var/dms/icons/dd-120.png b/octoserve/var/dms/icons/dd-120.png new file mode 100644 index 0000000..6c1356f Binary files /dev/null and b/octoserve/var/dms/icons/dd-120.png differ diff --git a/octoserve/var/dms/icons/dd-48.jpg b/octoserve/var/dms/icons/dd-48.jpg new file mode 100644 index 0000000..6b9984b Binary files /dev/null and b/octoserve/var/dms/icons/dd-48.jpg differ diff --git a/octoserve/var/dms/icons/dd-48.png b/octoserve/var/dms/icons/dd-48.png new file mode 100644 index 0000000..3a7d1d9 Binary files /dev/null and b/octoserve/var/dms/icons/dd-48.png differ diff --git a/octoserve/var/dms/start.sh b/octoserve/var/dms/start.sh new file mode 100644 index 0000000..ebcbd92 --- /dev/null +++ b/octoserve/var/dms/start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/lua + +killall lua +sleep 3 +lua dms.lua& diff --git a/octoserve/var/mcsetup/astra19e.csv b/octoserve/var/mcsetup/astra19e.csv new file mode 100644 index 0000000..6019189 --- /dev/null +++ b/octoserve/var/mcsetup/astra19e.csv @@ -0,0 +1,12 @@ +TITLE,REQUEST,PIDS,LANPORTS +"Das Erste","?src=1&freq=11837&msys=dvbs&sr=27500&pol=h","P0:100:101:104:102:103:106","" +"Bayerisches FS Nord","-","P0:500:201:204:202:203:206","" +"hr-fernsehen","-","P0:300:301:304:302:303","" +"SWR Fernsehen BW","-","P0:800:801:804:802:803:806","" +"WDR Köln","-","P0:600:601:604:602:603","" +"ZDF","?src=1&freq=11954&msys=dvbs&sr=27500&pol=h","P0:100:110:130:120:121:122:125","" +"zdf neo","-","P0:650:660:680:670:671:672:675","" +"zdf kultur","-","P0:1100:1110:1130:1120:1121:1122:1125","" +"ZDFInfo","-","P0:600:610:630:620:621:622:625","" +"KiKA","-","P0:300:310:330:320:321:325","L3:4:5" +"3sat","-","P0:200:210:230:220:221:222:225","" diff --git a/octoserve/var/mcsetup/kabelbw.csv b/octoserve/var/mcsetup/kabelbw.csv new file mode 100644 index 0000000..82e5e34 --- /dev/null +++ b/octoserve/var/mcsetup/kabelbw.csv @@ -0,0 +1,13 @@ +TITLE,REQUEST,PIDS,LANPORTS +"Das Erste","?freq=346&msys=dvbc&sr=6900&mtype=256qam","P0:100:101:104:102:103:106","" +"Bayerisches FS Nord","-","P0:500:201:204:202:203:206","" +"hr-fernsehen","-","P0:300:301:304:302:303","" +"SWR Fernsehen BW","-","P0:800:801:804:802:803:806","" +"WDR Köln","-","P0:600:601:604:602:603","" +"ZDF","?freq=370&msys=dvbc&sr=6900&mtype=256qam","P0:100:110:130:120:121:122:125","" +"ZDF HD","-","P0:6100:6110:6130:6120:6121:6122:6123","" +"zdf neo","-","P0:650:660:680:670:671:672:675","" +"zdf kultur","-","P0:1100:1110:1130:1120:1121:1122:1125","" +"ZDFInfo","-","P0:600:610:630:620:621:622:625","" +"KiKA","-","P0:300:310:330:320:321:325","L3:4:5" +"3sat","-","P0:200:210:230:220:221:222:225","" diff --git a/octoserve/var/mcsetup/kabelbw_udp.csv b/octoserve/var/mcsetup/kabelbw_udp.csv new file mode 100644 index 0000000..2e09ec2 --- /dev/null +++ b/octoserve/var/mcsetup/kabelbw_udp.csv @@ -0,0 +1,13 @@ +TITLE,REQUEST,PIDS,PROTO,IP,PORT,TTL,LANPORTS +"Das Erste","?freq=346&msys=dvbc&sr=6900&mtype=256qam","P0:100:101:104:102:103:106","UDP","239.7.7.100",1234,7,"" +"Bayerisches FS Nord","-","P0:500:201:204:202:203:206","UDP","239.7.7.101",1234,7,"" +"hr-fernsehen","-","P0:300:301:304:302:303","UDP","239.7.7.102",1234,7,"" +"SWR Fernsehen BW","-","P0:800:801:804:802:803:806","UDP","239.7.7.103",1234,7,"" +"WDR Köln","-","P0:600:601:604:602:603","UDP","239.7.7.104",1234,7,"" +"ZDF","?freq=370&msys=dvbc&sr=6900&mtype=256qam","P0:100:110:130:120:121:122:125","UDP","239.7.8.100",1234,7,"" +"ZDF HD","-","P0:6100:6110:6130:6120:6121:6122:6123","UDP","239.7.8.101",1234,7,"" +"zdf neo","-","P0:650:660:680:670:671:672:675","UDP","239.7.8.102",1234,7,"" +"zdf kultur","-","P0:1100:1110:1130:1120:1121:1122:1125","UDP","239.7.8.103",1234,7,"" +"ZDFInfo","-","P0:600:610:630:620:621:622:625","UDP","239.7.8.104",1234,7,"" +"KiKA","-","P0:300:310:330:320:321:325","UDP","239.7.8.105",1234,7,"L3:4:5" +"3sat","-","P0:200:210:230:220:221:222:225","UDP","239.7.8.106",1234,7,"" diff --git a/octoserve/var/mcsetup/mc.lua b/octoserve/var/mcsetup/mc.lua new file mode 100644 index 0000000..212e353 --- /dev/null +++ b/octoserve/var/mcsetup/mc.lua @@ -0,0 +1,251 @@ +#!/usr/bin/lua + +mc = {} + +local DebugFlag = true + +function mc.CheckSignal() + local tmp = io.open("/tmp/mc.signal") + if tmp then + tmp:close() + os.remove("/tmp/mc.signal") + return true + end + return nil +end + +function mc:ReadSetupFile(filename) + local list = {} + local file = io.open(filename,"r") + print(filename,file) + if file then + local line = file:read() + if line then + if DebugFlag then print(line) end + line = string.gsub(line,'"','') + if line:match("TITLE,REQUEST,PIDS,LANPORTS") then + while true do + line = file:read() + if not line then break end + if DebugFlag then print(line) end + local title,request,pids,lanports = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"L(%a-[%d%:]-)%"') + if not title then + title,request,pids = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%"') + end + if not title or not request or not pids then + break + end + if pids == "" then break end + + pids = string.gsub(pids,":",",") + if lanports then + lanports = string.gsub(lanports,":",",") + if lanports == "" then lanports = nil end + if lanports == "all" then lanports = "1,2,3,4,5" end + end + local url + if request == "" or string.sub(request,1,1) ~= "?" then + url = "stream=%d?pids=" .. pids + else + url = request .. "&pids=" .. pids + end + table.insert(list,{ url = url, lanports = lanports }) + end + elseif line:match("TITLE,REQUEST,PIDS,PROTO,IP,PORT,TTL,LANPORTS") then + while true do + line = file:read() + if not line then break end + if DebugFlag then print(line) end + local title,request,pids,proto,ip,port,ttl,lanports = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"(%u%u%u)%",%"(%d*%.%d*%.%d*%.%d*)%",(%d*),(%d*),%"L(%a-[%d%:]-)%"') + if not title then + title,request,pids,proto,ip,port,ttl = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"(%u%u%u)%",%"(%d*%.%d*%.%d*%.%d*)%",(%d*),(%d*)') + end + if not title or not request or not pids then + break + end + if pids == "" then break end + if proto ~= "UDP" and proto ~= "RTP" then break end + + pids = string.gsub(pids,":",",") + if lanports then + lanports = string.gsub(lanports,":",",") + if lanports == "" then lanports = nil end + if lanports == "all" then lanports = "1,2,3,4,5" end + end + local url + if request == "" or string.sub(request,1,1) ~= "?" then + url = "stream=%d?pids=" .. pids + else + url = request .. "&pids=" .. pids + end + table.insert(list,{ url = url, proto = proto, ip = ip, port = port, ttl = ttl, lanports = lanports }) + end + end + end + file:close() + end + return list +end + +function mc:Setup(mclist,serverip,devid) + local streamid = 0 + local port = 6670 + local req = nil + local dest = 1 + local SessionList = {} + local entry + + for _,entry in ipairs(mclist) do + print("*************************************************************************") + req = entry.url + local rc = nil + local attributes = nil + local sdp = nil + local server = socket.tcp() + server:settimeout(2) + local cseq = 1 + if server:connect(serverip,554) then + --local transport = string.format("RTP/AVP;multicast;port=%d-%d;ttl=5",port,port + 1) + local destip = string.format("239.%d.2.%d",devid,dest); + local destport = port; + local ttl = 5 + if entry.ip then + destip = entry.ip + end + if entry.port then + destport = tonumber(entry.port) + end + if entry.ttl then + ttl = tonumber(entry.ttl) + end + local transport = nil + if entry.proto and entry.proto == "UDP" then + transport = string.format("UDP;multicast;destination=%s;port=%d;ttl=%d",destip,destport,ttl) + else + transport = string.format("RTP/AVP;multicast;destination=%s;port=%d-%d;ttl=%d",destip,destport,destport + 1,ttl) + end + + -- port = port + 2 + if string.match(req,"stream") then + if streamid > 0 then + req = string.format(req,streamid) + rtsp:SendRequest(server,serverip,"SETUP",req,cseq,transport) + rc,attributes,sdp = rtsp:ReadResponse(server) + cseq = cseq + 1 + if rc == "200" then + session = string.match(attributes["SESSION"],"^(%w*);") + table.insert(SessionList,{ id = session, streamid = streamid, lanports = entry.lanports }) + end + end + else + rtsp:SendRequest(server,serverip,"SETUP",req,cseq,transport) + rc,attributes,sdp = rtsp:ReadResponse(server) + cseq = cseq + 1 + if rc == "200" then + streamid = tonumber(attributes["COM.SES.STREAMID"]) + session = string.match(attributes["SESSION"],"^(%w*);") + table.insert(SessionList,{ id = session, streamid = streamid, lanports = entry.lanports }) + end + end + server:close() + else + print("Connect?") + break + end + if rc ~= "200" then + break + end + dest = dest + 1 + end + return SessionList +end + +function mc:Play(SessionList,serverip) + if #SessionList > 0 then + local index,session + for index,session in ipairs(SessionList) do + print("*************************************************************************",index) + if session.lanports then + local server = socket.tcp() + server:settimeout(2) + if server:connect(serverip,554) then + local req = string.format("stream=%d",session.streamid) + rtsp:SendRequest(server,serverip,"PLAY",req,1,session.id, "switch="..session.lanports) + local rc,attributes,sdp = rtsp:ReadResponse(server) + server:close() + end + end + end + end +end + +local function pKeepAlive(mc,SessionList,ip) + local index = 1 + local server = socket.tcp() + server:settimeout(2) + local cseq = 1 + print(SessionList,ip) + local status = 0 + if server:connect(ip,554) then + while status do + socket.select(nil, nil, 3) + if mc.CheckSignal() then + status = 2 + break + end + print("*************************************************",index,SessionList[index].id) + local err = rtsp:SendRequest(server,ip,"DESCRIBE",nil,cseq,SessionList[index].id) + if err then + print(err) + break + end + local rc,attributes,sdp = rtsp:ReadResponse(server) + if not rc or rc ~= "200" then + break + end + cseq = cseq + 1 + index = index + 1 + if index > #SessionList then + index = 1 + end + collectgarbage() + end + server:close() + end + return status +end + +function mc:KeepAlive(SessionList,serverip) + if #SessionList > 0 then + local rc,status = pcall(pKeepAlive,mc,SessionList,serverip) + if not rc then + print(status) + return 1 + else + return status + end + end + return 0 +end + +function mc:TearDown(SessionList,serverip) + if #SessionList > 0 then + local index,session + for index,session in ipairs(SessionList) do + print("*************************************************************************",index) + local server = socket.tcp() + server:settimeout(2) + if server:connect(serverip,554) then + local req = string.format("stream=%d",session.streamid) + rtsp:SendRequest(server,serverip,"TEARDOWN",req,1,session.id) + local rc,attributes,sdp = rtsp:ReadResponse(server) + server:close() + if rc ~= "200" then + print("error",rc) + end + end + end + end +end + +return mc diff --git a/octoserve/var/mcsetup/mcsetup.lua b/octoserve/var/mcsetup/mcsetup.lua new file mode 100755 index 0000000..9ce70c0 --- /dev/null +++ b/octoserve/var/mcsetup/mcsetup.lua @@ -0,0 +1,112 @@ +#!/usr/bin/lua + +local socket = require("socket") +local mime = require("mime") +local rtsp = require("rtsp") +local mc = require("mc") + +local ip = "10.0.4.53" +local devid = 5 +local DoPlay = true +local mclist = false +local configfile = "/config/mcsetup.csv" +local server = false + +local a +for _,a in ipairs(arg) do + if a == "server" then server = true end + if a == "noplay" then DoPlay = false end +end + +function GetIPAddr() + local myip = nil + local ifconfig = io.popen("ifconfig eth0") + if ifconfig then + local eth0 = ifconfig:read("*a") + ifconfig:close() + myip = string.match(eth0,"inet addr%:(%d+%.%d+%.%d+%.%d+)") + end + return myip +end + +function GetDevID() + local devid = nil + local tmp = io.open("/config/device.id") + if tmp then + devid = tonumber(tmp:read()) + tmp:close() + end + return devid +end + +function WaitSignal() + print("WaitSignal") + while true do + socket.select(nil,nil,1) + end + print("Exit WaitSignal") +end + +if server then + socket.select(nil,nil,10) +end + +while true do + + ip = GetIPAddr() + devid = GetDevID() + print(ip,devid) + + if devid and ip then + mclist = mc:ReadSetupFile(configfile) + print(mclist,#mclist) + if #mclist > 0 then + local SessionList = mc:Setup(mclist,ip,devid) + if #SessionList > 0 then + + if DoPlay then + mc:Play(SessionList,ip) + end + + local rc = mc:KeepAlive(SessionList,ip) + if rc > 0 then + mc:TearDown(SessionList,ip) + end + if rc == 1 then + break + end + if rc == 0 then + socket.select(nil,nil,10) + end + end + else + while not mc.CheckSignal() do + socket.select(nil,nil,1) + end + end + end + collectgarbage() +end + + + + -- local server = socket.tcp() + -- server:settimeout(2) + + -- local cseq = 1 + + -- if server:connect(ip,554) then + -- rtsp:SendRequest(server,ip,"DESCRIBE",nil,cseq) + -- local rc,attributes,sdp = rtsp:ReadResponse(server) + -- cseq = cseq + 1 + -- print(rc) + -- for n,a in pairs(attributes) do + -- print(n,a) + -- end + -- if sdp then + -- for i,a in ipairs(sdp) do + -- print(string.format("%2d:%s",i,a)) + -- end + -- end + -- server:close() + -- end diff --git a/octoserve/var/mcsetup/rtsp.lua b/octoserve/var/mcsetup/rtsp.lua new file mode 100644 index 0000000..4e10a61 --- /dev/null +++ b/octoserve/var/mcsetup/rtsp.lua @@ -0,0 +1,94 @@ +#!/usr/bin/lua + +rtsp = {} + +local DebugFlag = true +local CRLF = "\r\n" + +local function SplitLines(s) + local lines = {} + local line = nil + for line in string.gmatch(s,"(.-)"..CRLF) do + table.insert(lines,line) + end + return lines +end + +function rtsp:ReadResponse(server) + + local linenum = 0 + local line, err = server:receive() + + if err then + if DebugFlag then print("RTSP Error "..err) end + return + end + + if DebugFlag then print(string.format("%2d:%s",linenum,line)) end + local rc = string.match(line,"%s+(%d+)") + local attributes = {} + + while true do + local line, err = server:receive() + if err then + if DebugFlag then print("RTSP Error "..err.." Line: "..tostring(linenum)) end + return + end + linenum = linenum + 1 + if DebugFlag then print(string.format("%2d:%s",linenum,line)) end + if line == "" then break end + + if linenum == 30 then + if DebugFlag then print("RTSP Error "..tostring(linenum)) end + return + end + + local n,v = string.match(line,"([%a%-%.]+)%s*%:%s*(.*)") + if n and v then + attributes[string.upper(n)] = v + end + + end + + local sdp = nil + local ctype = attributes["CONTENT-TYPE"] + if ctype then + if string.lower(ctype) == "application/sdp" then + local clen = attributes["CONTENT-LENGTH"] + line, err = server:receive(tonumber(clen)) + if err then + if DebugFlag then print("RTSP Error "..err.." Line: "..tostring(linenum)) end + return + else + sdp = SplitLines(line) + end + end + end + return rc,attributes,sdp +end + +function rtsp:SendRequest(server,ip,command,request,cseq,session_transport,x_octonet) + if not request then request = "" end + local s = command .. " rtsp://"..ip..":554/"..request.." RTSP/1.0" .. CRLF + .. "User-Agent: DD_MCSetup" .. CRLF + if cseq then s = s .. "Cseq: ".. tostring(cseq)..CRLF end + if session_transport then + if command == "SETUP" then + s = s .. "Transport: "..session_transport..CRLF + else + s = s .. "Session:" ..session_transport..CRLF + end + end + if x_octonet then + s = s .. "x_octonet: "..x_octonet..CRLF + end + s = s .. CRLF + if DebugFlag then print(s) end + local r,err = server:send(s) + if not r then + return err + end + return nil +end + +return rtsp diff --git a/octoserve/var/mcsetup/unitymedia.csv b/octoserve/var/mcsetup/unitymedia.csv new file mode 100644 index 0000000..99211a1 --- /dev/null +++ b/octoserve/var/mcsetup/unitymedia.csv @@ -0,0 +1,13 @@ +TITLE,REQUEST,PIDS,LANPORTS +"Das Erste","?freq=410&msys=dvbc&sr=6900&mtype=256qam","P0:100:101:104:102:103:106","" +"Bayerisches FS Nord","-","P0:500:201:204:202:203:206","" +"hr-fernsehen","-","P0:300:301:304:302:303","" +"SWR Fernsehen BW","-","P0:800:801:804:802:803:806","" +"WDR Köln","-","P0:600:601:604:602:603","" +"ZDF","?freq=394&msys=dvbc&sr=6900&mtype=256qam","P0:100:110:130:120:121:122:125","" +"ZDF HD","-","P0:6100:6110:6130:6120:6121:6122:6123","" +"zdf neo","-","P0:650:660:680:670:671:672:675","" +"zdf kultur","-","P0:1100:1110:1130:1120:1121:1122:1125","" +"ZDFInfo","-","P0:600:610:630:620:621:622:625","" +"KiKA","-","P0:300:310:330:320:321:325","L3:4:5" +"3sat","-","P0:200:210:230:220:221:222:225","" diff --git a/octoserve/var/satip/www/icons/dd-120.jpg b/octoserve/var/satip/www/icons/dd-120.jpg new file mode 100644 index 0000000..86bf2c7 Binary files /dev/null and b/octoserve/var/satip/www/icons/dd-120.jpg differ diff --git a/octoserve/var/satip/www/icons/dd-120.png b/octoserve/var/satip/www/icons/dd-120.png new file mode 100644 index 0000000..6c1356f Binary files /dev/null and b/octoserve/var/satip/www/icons/dd-120.png differ diff --git a/octoserve/var/satip/www/icons/dd-48.jpg b/octoserve/var/satip/www/icons/dd-48.jpg new file mode 100644 index 0000000..6b9984b Binary files /dev/null and b/octoserve/var/satip/www/icons/dd-48.jpg differ diff --git a/octoserve/var/satip/www/icons/dd-48.png b/octoserve/var/satip/www/icons/dd-48.png new file mode 100644 index 0000000..3a7d1d9 Binary files /dev/null and b/octoserve/var/satip/www/icons/dd-48.png differ diff --git a/octoserve/var/www/BannerDD.jpg b/octoserve/var/www/BannerDD.jpg new file mode 100644 index 0000000..cdeed4b Binary files /dev/null and b/octoserve/var/www/BannerDD.jpg differ diff --git a/octoserve/var/www/SCIFDataBase.xml b/octoserve/var/www/SCIFDataBase.xml new file mode 100644 index 0000000..2244c62 --- /dev/null +++ b/octoserve/var/www/SCIFDataBase.xml @@ -0,0 +1,670 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/octoserve/var/www/beta.html b/octoserve/var/www/beta.html new file mode 100644 index 0000000..db13e49 --- /dev/null +++ b/octoserve/var/www/beta.html @@ -0,0 +1,55 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ + + + + + +
+
+ + +
+
+
+ + +
+
+ +
+
 
+ + + diff --git a/octoserve/var/www/beta.lua b/octoserve/var/www/beta.lua new file mode 100644 index 0000000..274fc36 --- /dev/null +++ b/octoserve/var/www/beta.lua @@ -0,0 +1,31 @@ +#!/usr/bin/lua + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +function http_print(s) + if s then + io.stdout:write(tostring(s).."\r\n") + else + io.stdout:write("\r\n") + end +end + +local userver = "download.digital-devices.de/download/linux" + +if query == "set=beta" then + local file = io.open("/config/updateserver","w") + if file then + file:write(userver.."/beta/".."\n") + file:close() + end +elseif query == "set=std" then + os.remove("/config/updateserver") + os.execute("rm -f /config/octonet.*.img") + os.execute("rm -f /config/octonet.*.sha") +end + +http_print(proto.." 303") +http_print("Location: http://"..host.."/update.html") +http_print("") diff --git a/octoserve/var/www/browsertv.html b/octoserve/var/www/browsertv.html new file mode 100644 index 0000000..8daee8a --- /dev/null +++ b/octoserve/var/www/browsertv.html @@ -0,0 +1,367 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ + + + + + + + + +
+
+ + + + + +
 
+
+ Audio:  + + + + + +
+
+
+
+
+
+ + + + + + + + + + +
Source +
+ +
+
Channel +
+ +
+
+
+
+ +
+ + +
+
 
+ + + diff --git a/octoserve/var/www/btvchannels.lua b/octoserve/var/www/btvchannels.lua new file mode 100644 index 0000000..0a17e48 --- /dev/null +++ b/octoserve/var/www/btvchannels.lua @@ -0,0 +1,129 @@ +#!/usr/bin/lua + +local db = require("DataBase") + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +print(proto.." 200") +--print("Pragma: no-cache") +print("Content-Type: application/x-javascript") +print("") + +local SourceList = {} + +for _,f in ipairs(db.SourceList) do + f.ChannelList = {} + SourceList[f.refid] = f + print("// " .. f.refid .. " " .. f.title ) +end + +for _,c in ipairs(db.ChannelList) do + local f = SourceList[c.refid] + if f then + table.insert(f.ChannelList,c) + -- print("// " .. c.refid .. " " .. c.title .. " " .. c.request .. " " .. c.tracks ) + end +end + +local isat = 0 +local icable = 0 +local iter = 0 +local ichannel = 0 + +print("var SourceListSat = new Array();") +print("var SourceListCable = new Array();") +print("var SourceListTer = new Array();") + +for _,f in pairs(SourceList) do + if f.system == "dvbs" or f.system == "dvbs2" then + print("") + print(string.format("SourceListSat[%d] = new Object();",isat)) + print(string.format("SourceListSat[%d].name = '%s';",isat,f.title)) + print(string.format("SourceListSat[%d].ChannelList = new Array();",isat)) + + ichannel = 0 + for _,c in ipairs(f.ChannelList) do + print("") + print(string.format("SourceListSat[%d].ChannelList[%d] = new Object();",isat,ichannel)) + print(string.format("SourceListSat[%d].ChannelList[%d].name = '%s';",isat,ichannel,string.gsub(c.title,"'","\\'"))) + print(string.format("SourceListSat[%d].ChannelList[%d].request = '?src=%s&%s';",isat,ichannel,f.src,c.request)) + print(string.format("SourceListSat[%d].ChannelList[%d].tracks = new Array(%s);",isat,ichannel,c.tracks)) + ichannel = ichannel + 1 + end + isat = isat + 1 + end + if f.system == "dvbc" or f.system == "dvbc2" then + print("") + print(string.format("SourceListCable[%d] = new Object();",icable)) + print(string.format("SourceListCable[%d].name = '%s';",icable,f.title)) + print(string.format("SourceListCable[%d].ChannelList = new Array();",icable)) + + ichannel = 0 + for _,c in ipairs(f.ChannelList) do + print("") + print(string.format("SourceListCable[%d].ChannelList[%d] = new Object();",icable,ichannel)) + print(string.format("SourceListCable[%d].ChannelList[%d].name = '%s';",icable,ichannel,string.gsub(c.title,"'","\\'"))) + print(string.format("SourceListCable[%d].ChannelList[%d].request = '?%s';",icable,ichannel,c.request)) + print(string.format("SourceListCable[%d].ChannelList[%d].tracks = new Array(%s);",icable,ichannel,c.tracks)) + ichannel = ichannel + 1 + end + icable = icable + 1 + end +end + +-- var ChannelListSat = new Array(); + +-- ChannelListSat[0] = new Object(); +-- ChannelListSat[0].name = "Astra 19E: Das Erste HD"; +-- ChannelListSat[0].request = "?src=1&freq=11494&pol=h&msys=dvbs&sr=22000&pids=0,5100,5101,5102,5103,5106,5104,5105"; +-- ChannelListSat[0].tracks = new Array( 5102, 5103, 5106 ); + +-- ChannelListSat[1] = new Object(); +-- ChannelListSat[1].name = "Astra 19E: ZDF HD"; +-- ChannelListSat[1].request = "?src=1&freq=11362&pol=h&msys=dvbs&sr=22000&pids=0,6100,6110,6120,6121,6122,6123,6131,6130"; +-- ChannelListSat[1].tracks = new Array( 6120, 6121, 6123, 6122 ); + +-- ChannelListSat[2] = new Object(); +-- ChannelListSat[2].name = "Eutelsat 9E: TF1 HD Suisse"; +-- ChannelListSat[2].request = "?src=1&freq=12034&pol=v&msys=dvbs&sr=27500&pids=0,800,810,820,821,822,850,814,815"; +-- ChannelListSat[2].tracks = new Array( 820, 821, 822 ); + +-- ChannelListSat[3] = new Object(); +-- ChannelListSat[3].name = "Eutelsat 9E: FTV HD Europe"; +-- ChannelListSat[3].request = "?src=1&freq=11881&pol=v&msys=dvbs&sr=27500&pids=0,1001,2001,3001,4001"; +-- ChannelListSat[3].tracks = new Array( 3001, 4001 ); + + +-- var ChannelListCable = new Array(); + +-- ChannelListCable[0] = new Object(); +-- ChannelListCable[0].name = "KabelBW: Das Erste HD"; +-- ChannelListCable[0].request = "?freq=362&msys=dvbc&sr=6900&mtype=256qam&pids=0,6000,6010,6020,6021,6030,6022,6031"; +-- ChannelListCable[0].tracks = new Array( 6020, 6021, 6022 ); + +-- ChannelListCable[1] = new Object(); +-- ChannelListCable[1].name = "KabelBW: ZDF HD"; +-- ChannelListCable[1].request = "?freq=370&msys=dvbc&sr=6900&mtype=256qam&pids=0,6100,6110,6120,6121,6123,6130,6122,6131"; +-- ChannelListCable[1].tracks = new Array( 6120, 6121, 6123, 6122 ); + +-- ChannelListCable[2] = new Object(); +-- ChannelListCable[2].name = "UnityMedia: Das Erste HD"; +-- ChannelListCable[2].request = "?freq=418&msys=dvbc&sr=6900&mtype=256qam&pids=0,6000,6010,6020,6021,6030,6022,6031"; +-- ChannelListCable[2].tracks = new Array( 6020, 6021, 6022 ); + +-- ChannelListCable[3] = new Object(); +-- ChannelListCable[3].name = "UnityMedia: ZDF HD"; +-- ChannelListCable[3].request = "?freq=394&msys=dvbc&sr=6900&mtype=256qam&pids=0,0,6100,6110,6120,6121,6123,6130,6122,6131"; +-- ChannelListCable[3].tracks = new Array( 6120, 6121, 6123, 6122 ); + +-- ChannelListCable[4] = new Object(); +-- ChannelListCable[4].name = "KDG: Das Erste HD"; +-- ChannelListCable[4].request = "?freq=330&msys=dvbc&sr=6900&mtype=256qam&pids=0,5100,5101,5102,5103,5105,5104"; +-- ChannelListCable[4].tracks = new Array( 5102, 5103 ); + +-- ChannelListCable[5] = new Object(); +-- ChannelListCable[5].name = "KDG: ZDF HD"; +-- ChannelListCable[5].request = "?freq=450&msys=dvbc&sr=6900&mtype=256qam&pids=0,6100,6110,6120,6121,6130,6123,6131"; +-- ChannelListCable[5].tracks = new Array( 6120, 6121, 6123 ); diff --git a/octoserve/var/www/channellists.html b/octoserve/var/www/channellists.html new file mode 100644 index 0000000..07272ca --- /dev/null +++ b/octoserve/var/www/channellists.html @@ -0,0 +1,96 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ + + + + + + + + + + + + +
System Channel Database + + + + + +
+
+ + +
+
+
+ + +
+
+
User Channel Database + + + + + + +
+
+ + +
+
+
+ + +
+
+
+ +
+
+
+
+ + +
+
+ +
+
 
+ + + diff --git a/octoserve/var/www/delchannels.lua b/octoserve/var/www/delchannels.lua new file mode 100644 index 0000000..5481621 --- /dev/null +++ b/octoserve/var/www/delchannels.lua @@ -0,0 +1,32 @@ +#!/usr/bin/lua + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +if arg[1] then + query = arg[1] + if query == "get" then query = "" end + proto = "HTTP/1.0" + host = "local" +end + +function SendError(err,desc) + io.stdout:write(proto.." "..err.."\r\n") + io.stdout:write("\r\n") + local file = io.open("e404.html") + if file then + local tmp = file:read("*a") + tmp = string.gsub(tmp,"404 Not Found",err .. " " .. desc) + io.stdout:write(tmp) + file:close() + end +end + + +os.execute("rm -rf /config/channels") + +io.stdout:write(proto.." 303".."\r\n") +io.stdout:write("Location: http://"..host.."/reboot.html".."\r\n") +io.stdout:write("\r\n") + diff --git a/octoserve/var/www/dlchannels.lua b/octoserve/var/www/dlchannels.lua new file mode 100644 index 0000000..c669ef3 --- /dev/null +++ b/octoserve/var/www/dlchannels.lua @@ -0,0 +1,66 @@ +#!/usr/bin/lua + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +if arg[1] then + query = arg[1] + if query == "get" then query = "" end + proto = "HTTP/1.0" + host = "local" +end + +function SendError(err,desc) + io.stdout:write(proto.." "..err.."\r\n") + io.stdout:write("\r\n") + local file = io.open("e404.html") + if file then + local tmp = file:read("*a") + tmp = string.gsub(tmp,"404 Not Found",err .. " " .. desc) + io.stdout:write(tmp) + file:close() + end +end + +local path = nil +local tmp = "/var/tmp/xxxx" + +if string.match(query,"select=user") then + local file = io.open("/config/channels/sourcelist.csv") + if file then + path = "/config/channels" + file:close() + else + path = "/var/channels" + end +elseif string.match(query,"select=system") then + path = "/var/channels" +else + SendError("404","channel list not found") + return +end + +local gz = nil + +os.execute("cd ".. path .. ";tar -cf " .. tmp .. ".tar" .. " *.csv *.txt"); + +local p = io.popen("gzip -c " .. tmp .. ".tar") +if p then + gz = p:read("*a") + p:close() +end + +if gz then + io.stdout:write(proto.." 200" .."\r\n") + io.stdout:write("Pragma: no-cache".."\r\n") + io.stdout:write("Content-Type: application/gzip".."\r\n") + io.stdout:write('Content-Disposition: filename="channels.tar.gz"'.."\r\n") + io.stdout:write(string.format("Content-Length: %d",#gz).."\r\n") + io.stdout:write("\r\n") + io.stdout:write(gz) +else + SendError("500","internal error") +end + + diff --git a/octoserve/var/www/doupdate.html b/octoserve/var/www/doupdate.html new file mode 100644 index 0000000..bc71532 --- /dev/null +++ b/octoserve/var/www/doupdate.html @@ -0,0 +1,165 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ +

DO NOT TURN THE DEVICE OFF

+ + + + + + + +
  
+
+ +
+
+ + + +
+
 
+ + + diff --git a/octoserve/var/www/e404.html b/octoserve/var/www/e404.html new file mode 100644 index 0000000..5ae4aca --- /dev/null +++ b/octoserve/var/www/e404.html @@ -0,0 +1,41 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ +

404 Not Found

+ +
+
 
+ + + diff --git a/octoserve/var/www/index.html b/octoserve/var/www/index.html new file mode 100644 index 0000000..3e971d2 --- /dev/null +++ b/octoserve/var/www/index.html @@ -0,0 +1,131 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ + + + + + + + + + + + +
+

OctopusNet + +

+
+ +
+
+ +
+
+ +
+
 
+ + + diff --git a/octoserve/var/www/licenses.html b/octoserve/var/www/licenses.html new file mode 100644 index 0000000..34b62ea --- /dev/null +++ b/octoserve/var/www/licenses.html @@ -0,0 +1,4996 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ + +
+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

buildroot: COPYING file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+

Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. +

+

GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +

+

0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+

Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

+
    +
  1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +
+

You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+
    +
  1. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +
  2. You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +
  3. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +
+

These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +

+

Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+

In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

+

3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

+
    +
  1. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +
  2. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
  3. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+

The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+

If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. +

+

4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. +

+

5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

+

6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

+

7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+

If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+

It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+

This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. +

+

8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. +

+

9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

+

10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

+

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITIONS +

+

How to Apply These Terms to Your New Programs +

+

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> +

+

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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: +

+

Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. +

+

You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: +

+

Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. +

+

<signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice +

+

This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

busybox: LICENSE file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+

--- A note on GPL versions +

+

BusyBox is distributed under version 2 of the General Public License (included +in its entirety, below). Version 2 is the only version of this license which +this version of BusyBox (or modified versions derived from this one) may be +distributed under. +

+
+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+

Copyright (C) 1989, 1991 Free Software Foundation, Inc. +

51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. + +


+ +

GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +

+

0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+

Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

+
    +
  1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +
+

You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+
    +
  1. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +
  2. You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +
  3. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +
    + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +
+

Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+

In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

+

3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

+
    +
  1. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +
  2. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
  3. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+

The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+

If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +


+ + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +

5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

+

6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

+

7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+

If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+

It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+

This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +


+ + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +

9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

+

10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

+

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITIONS + +


+ + How to Apply These Terms to Your New Programs + +

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> +

+

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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: +

+

Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. +

+

You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: +

+

Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. +

+

<signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice +

+

This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

lua: COPYRIGHT file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+

Lua License

+ +

Lua is licensed under the terms of the MIT license reproduced below. +This means that Lua is free software and can be used for both academic +and commercial purposes at absolutely no cost. +

+

For details and rationale, see http://www.lua.org/license.html . +

+
+ +

Copyright (C) 1994-2012 Lua.org, PUC-Rio. +

+

Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +

+

The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +

+

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +

+
+ +

(end of COPYRIGHT) +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

mtd: COPYING file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+

Copyright (C) 1989, 1991 Free Software Foundation, Inc. +

59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. + +


+ +

GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +

+

0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+

Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

+
    +
  1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +
+

You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+
    +
  1. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +
  2. You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +
  3. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +
    + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +
+

Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+

In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

+

3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

+
    +
  1. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +
  2. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
  3. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+

The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+

If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +


+ + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +

5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

+

6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

+

7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+

If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+

It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+

This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +


+ + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +

9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

+

10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

+

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITIONS + +


+ + How to Apply These Terms to Your New Programs + +

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> +

+

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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: +

+

Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. +

+

You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: +

+

Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. +

+

<signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice +

+

This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

uboot-tools: COPYING file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+

U-Boot is Free Software. It is copyrighted by Wolfgang Denk and +many others who contributed code (see the actual source code for +details). You can redistribute U-Boot and/or modify it under the +terms of version 2 of the GNU General Public License as published by +the Free Software Foundation. Most of it can also be distributed, +at your option, under any later version of the GNU General Public +License -- see individual files for exceptions. +

+

NOTE! This license does not cover the so-called "standalone" +applications that use U-Boot services by means of the jump table +provided by U-Boot exactly for this purpose - this is merely +considered normal use of U-Boot, and does not fall under the +heading of "derived work". +

+

The header files "include/image.h" and "include/asm-*/u-boot.h" +define interfaces to U-Boot. Including these (unmodified) header +files in another file is considered normal use of U-Boot, and does +not fall under the heading of "derived work". +

+

Also note that the GPL below is copyrighted by the Free Software +Foundation, but the instance of code that it refers to (the U-Boot +source code) is copyrighted by me and others who actually wrote it. +-- Wolfgang Denk +

+
+ +
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+

Copyright (C) 1989, 1991 Free Software Foundation, Inc. +

59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. + +


+ +

GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +

+

0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+

Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

+
    +
  1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +
+

You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+
    +
  1. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +
  2. You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +
  3. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +
    + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +
+

Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+

In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

+

3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

+
    +
  1. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +
  2. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
  3. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+

The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+

If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +


+ + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +

5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

+

6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

+

7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+

If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+

It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+

This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +


+ + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +

9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

+

10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

+

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITIONS +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

ccache: LICENSE.txt file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+

ccache copyright and license

+ +

Overall license

+ +

The license for ccache as a whole is as follows: +

+
+ 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 the Free Software + Foundation; either version 3 of the License, or (at your option) any later + version. + +

This program is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 51 Franklin + Street, Fifth Floor, Boston, MA 02110-1301 USA +


+ +

The full license text can be found in GPL-3.0.txt and at +http://www.gnu.org/licenses/gpl-3.0.html. +

+

Copyright and authors

+ +

ccache is a collective work with contributions from many people, listed in +AUTHORS.txt and at http://ccache.samba.org/authors.html. Subsequent additions +by contributing authors are implicitly licensed to the public under the same +terms (GNU GPL version 3 or later), but the contributing authors retain +copyrights on their portions of the work. +

+

The copyright for ccache as a whole is as follows: +

+
+ Copyright (C) 2002-2007 Andrew Tridgell + Copyright (C) 2009-2011 Joel Rosdahl +
+ +

Files derived from other sources

+ +

The ccache distribution contain some files from other sources and some have +been modified for use in ccache. These files all carry attribution notices, and +may qualify as ``separate and independent works in themselves'' for purposes of +the GPL: that is, if separated from the ccache sources, they may be usable +under less restrictive terms. +

+

getopt_long.[hc]

+ +

This implementation of `getopt_long()` was copied from +http://www.postgresql.org[PostgreSQL] and has the following license text: +

+
+ Portions Copyright (c) 1987, 1993, 1994 + The Regents of the University of California. All rights reserved. + +

Portions Copyright (c) 2003
+ PostgreSQL Global Development Group +

+

Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: +

    +
  1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +
  2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +
  3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. +
+

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +


+ +

hashtable*.[hc]

+ +

This code comes from http://www.cl.cam.ac.uk/~cwc22/hashtable/ with the +following license: +

+
+ Copyright (c) 2002, 2004, Christopher Clark + All rights reserved. + +

Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: +

+
    +
  • Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +
  • Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +
  • Neither the name of the original author; nor the names of any + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. +
+

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +


+ +

m4/feature_macros.m4

+ +

This Autoconf M4 snippet comes from http://www.python.org[Python] 2.6's +`configure.in` with the following license: +

+
+
    +
  1. HISTORY OF THE SOFTWARE +
    +
+

Python was created in the early 1990s by Guido van Rossum at Stichting + Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands + as a successor of a language called ABC. Guido remains Python's + principal author, although it includes many contributions from others. +

+

In 1995, Guido continued his work on Python at the Corporation for + National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) + in Reston, Virginia where he released several versions of the + software. +

+

In May 2000, Guido and the Python core development team moved to + BeOpen.com to form the BeOpen PythonLabs team. In October of the same + year, the PythonLabs team moved to Digital Creations (now Zope + Corporation, see http://www.zope.com). In 2001, the Python Software + Foundation (PSF, see http://www.python.org/psf/) was formed, a + non-profit organization created specifically to own Python-related + Intellectual Property. Zope Corporation is a sponsoring member of + the PSF. +

+

All Python releases are Open Source (see http://www.opensource.org for + the Open Source Definition). Historically, most, but not all, Python + releases have also been GPL-compatible; the table below summarizes + the various releases. +

+
+      Release         Derived     Year        Owner       GPL-
+                      from                                compatible? (1)
+
+      0.9.0 thru 1.2              1991-1995   CWI         yes
+      1.3 thru 1.5.2  1.2         1995-1999   CNRI        yes
+      1.6             1.5.2       2000        CNRI        no
+      2.0             1.6         2000        BeOpen.com  no
+      1.6.1           1.6         2001        CNRI        yes (2)
+      2.1             2.0+1.6.1   2001        PSF         no
+      2.0.1           2.0+1.6.1   2001        PSF         yes
+      2.1.1           2.1+2.0.1   2001        PSF         yes
+      2.2             2.1.1       2001        PSF         yes
+      2.1.2           2.1.1       2002        PSF         yes
+      2.1.3           2.1.2       2002        PSF         yes
+      2.2.1           2.2         2002        PSF         yes
+      2.2.2           2.2.1       2002        PSF         yes
+      2.2.3           2.2.2       2003        PSF         yes
+      2.3             2.2.2       2002-2003   PSF         yes
+      2.3.1           2.3         2002-2003   PSF         yes
+      2.3.2           2.3.1       2002-2003   PSF         yes
+      2.3.3           2.3.2       2002-2003   PSF         yes
+      2.3.4           2.3.3       2004        PSF         yes
+      2.3.5           2.3.4       2005        PSF         yes
+      2.4             2.3         2004        PSF         yes
+      2.4.1           2.4         2005        PSF         yes
+      2.4.2           2.4.1       2005        PSF         yes
+      2.4.3           2.4.2       2006        PSF         yes
+      2.4.4           2.4.3       2006        PSF         yes
+      2.5             2.4         2006        PSF         yes
+      2.5.1           2.5         2007        PSF         yes
+      2.5.2           2.5.1       2008        PSF         yes
+      2.5.3           2.5.2       2008        PSF         yes
+      2.6             2.5         2008        PSF         yes
+      2.6.1           2.6         2008        PSF         yes
+
+
+
Footnotes
+
+
+

(1) GPL-compatible doesn't mean that we're distributing Python under +

+      the GPL.  All Python licenses, unlike the GPL, let you distribute
+      a modified version without making your changes open source.  The
+      GPL-compatible licenses make it possible to combine Python with
+      other software that is released under the GPL; the others don't.
+
+

(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, +

+      because its license has a choice of law clause.  According to
+      CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
+      is "not incompatible" with the GPL.
+
+

Thanks to the many outside volunteers who have worked under Guido's + direction to make these releases possible. +

+

B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON

+ +
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+ +
    +
  1. This LICENSE AGREEMENT is between the Python Software Foundation + ("PSF"), and the Individual or Organization ("Licensee") accessing and + otherwise using this software ("Python") in source or binary form and + its associated documentation. +
  2. Subject to the terms and conditions of this License Agreement, PSF hereby + grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, + analyze, test, perform and/or display publicly, prepare derivative works, + distribute, and otherwise use Python alone or in any derivative version, + provided, however, that PSF's License Agreement and PSF's notice of copyright, + i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python + Software Foundation; All Rights Reserved" are retained in Python alone or in any + derivative version prepared by Licensee. +
  3. In the event Licensee prepares a derivative work that is based on + or incorporates Python or any part thereof, and wants to make + the derivative work available to others as provided herein, then + Licensee hereby agrees to include in any such work a brief summary of + the changes made to Python. +
  4. PSF is making Python available to Licensee on an "AS IS" + basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. +
  5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. +
  6. This License Agreement will automatically terminate upon a material + breach of its terms and conditions. +
  7. Nothing in this License Agreement shall be deemed to create any + relationship of agency, partnership, or joint venture between PSF and + Licensee. This License Agreement does not grant permission to use PSF + trademarks or trade name in a trademark sense to endorse or promote + products or services of Licensee, or any third party. +
  8. By copying, installing or otherwise using Python, Licensee + agrees to be bound by the terms and conditions of this License + Agreement. +
+
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
+ +

BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 +

+
    +
  1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an + office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the + Individual or Organization ("Licensee") accessing and otherwise using + this software in source or binary form and its associated + documentation ("the Software"). +
  2. Subject to the terms and conditions of this BeOpen Python License + Agreement, BeOpen hereby grants Licensee a non-exclusive, + royalty-free, world-wide license to reproduce, analyze, test, perform + and/or display publicly, prepare derivative works, distribute, and + otherwise use the Software alone or in any derivative version, + provided, however, that the BeOpen Python License is retained in the + Software, alone or in any derivative version prepared by Licensee. +
  3. BeOpen is making the Software available to Licensee on an "AS IS" + basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. +
  4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. +
  5. This License Agreement will automatically terminate upon a material + breach of its terms and conditions. +
  6. This License Agreement shall be governed by and interpreted in all + respects by the law of the State of California, excluding conflict of + law provisions. Nothing in this License Agreement shall be deemed to + create any relationship of agency, partnership, or joint venture + between BeOpen and Licensee. This License Agreement does not grant + permission to use BeOpen trademarks or trade names in a trademark + sense to endorse or promote products or services of Licensee, or any + third party. As an exception, the "BeOpen Python" logos available at + http://www.pythonlabs.com/logos.html may be used according to the + permissions granted on that web page. +
  7. By copying, installing or otherwise using the software, Licensee + agrees to be bound by the terms and conditions of this License + Agreement. +
+
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
+ +
    +
  1. This LICENSE AGREEMENT is between the Corporation for National + Research Initiatives, having an office at 1895 Preston White Drive, + Reston, VA 20191 ("CNRI"), and the Individual or Organization + ("Licensee") accessing and otherwise using Python 1.6.1 software in + source or binary form and its associated documentation. +
  2. Subject to the terms and conditions of this License Agreement, CNRI + hereby grants Licensee a nonexclusive, royalty-free, world-wide + license to reproduce, analyze, test, perform and/or display publicly, + prepare derivative works, distribute, and otherwise use Python 1.6.1 + alone or in any derivative version, provided, however, that CNRI's + License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) + 1995-2001 Corporation for National Research Initiatives; All Rights + Reserved" are retained in Python 1.6.1 alone or in any derivative + version prepared by Licensee. Alternately, in lieu of CNRI's License + Agreement, Licensee may substitute the following text (omitting the + quotes): "Python 1.6.1 is made available subject to the terms and + conditions in CNRI's License Agreement. This Agreement together with + Python 1.6.1 may be located on the Internet using the following + unique, persistent identifier (known as a handle): 1895.22/1013. This + Agreement may also be obtained from a proxy server on the Internet + using the following URL: http://hdl.handle.net/1895.22/1013". +
  3. In the event Licensee prepares a derivative work that is based on + or incorporates Python 1.6.1 or any part thereof, and wants to make + the derivative work available to others as provided herein, then + Licensee hereby agrees to include in any such work a brief summary of + the changes made to Python 1.6.1. +
  4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" + basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. +
  5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. +
  6. This License Agreement will automatically terminate upon a material + breach of its terms and conditions. +
  7. This License Agreement shall be governed by the federal + intellectual property law of the United States, including without + limitation the federal copyright law, and, to the extent such + U.S. federal law does not apply, by the law of the Commonwealth of + Virginia, excluding Virginia's conflict of law provisions. + Notwithstanding the foregoing, with regard to derivative works based + on Python 1.6.1 that incorporate non-separable material that was + previously distributed under the GNU General Public License (GPL), the + law of the Commonwealth of Virginia shall govern this License + Agreement only as to issues arising under or with respect to + Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this + License Agreement shall be deemed to create any relationship of + agency, partnership, or joint venture between CNRI and Licensee. This + License Agreement does not grant permission to use CNRI trademarks or + trade name in a trademark sense to endorse or promote products or + services of Licensee, or any third party. +
  8. By clicking on the "ACCEPT" button where indicated, or by copying, + installing or otherwise using Python 1.6.1, Licensee agrees to be + bound by the terms and conditions of this License Agreement. +
+

ACCEPT +

+
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
+ +

Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, + The Netherlands. All rights reserved. +

+

Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Stichting Mathematisch + Centrum or CWI not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior + permission. +

+

STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +


+ +

murmurhashneutral2.[hc]

+ +

This fast hash implementation is released to the public domain by Austin +Appleby. See http://murmurhash.googlepages.com. +

+

snprintf.c and m4/snprintf.m4

+ +

This implementation of `snprintf()` and similar functions was downloaded from +http://www.jhweiss.de/software/snprintf.html and has the following license: +

+
+ Copyright (c) 1995 Patrick Powell. + +

This code is based on code written by Patrick Powell <papowell@astart.com>. + It may be used for any purpose as long as this notice remains intact on all + source code distributions. +

+

Copyright (c) 2008 Holger Weiss. +

+

This version of the code is maintained by Holger Weiss <holger@jhweiss.de>. + My changes to the code may freely be used, modified and/or redistributed for + any purpose. It would be nice if additions and fixes to this file (including + trivial code cleanups) would be sent back in order to let me include them in + the version available at <http://www.jhweiss.de/software/snprintf.html>. + However, this is not a requirement for using or redistributing (possibly + modified) versions of this file, nor is leaving this notice intact mandatory. +


+ +

zlib/*.[hc]

+ +

This is a bundled subset of zlib 1.2.3 from <http://www.zlib.net> with the +following license: +

+
+ Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + +

This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. +

+

Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: +

+
    +
  1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +
  2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +
  3. This notice may not be removed or altered from any source distribution. +
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+

The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +


+ +

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

ccache: GPL-3.0.txt file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The GNU General Public License is a free, copyleft license for +software and other kinds of works. +

+

The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. +

+

To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. +

+

Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. +

+

For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. +

+

Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. +

+

Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. +

+

The precise terms and conditions for copying, distribution and +modification follow. +

+

TERMS AND CONDITIONS +

+

0. Definitions. +

+

"This License" refers to version 3 of the GNU General Public License. +

+

"Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +

"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. +

+

To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. +

+

A "covered work" means either the unmodified Program or a work based +on the Program. +

+

To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. +

+

To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. +

+

An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. +

+
    +
  1. Source Code. +
+

The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. +

+

A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. +

+

The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. +

+

The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. +

+

The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. +

+

The Corresponding Source for a work in source code form is that +same work. +

+

2. Basic Permissions. +

+

All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. +

+

You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. +

+

Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. +

+

3. Protecting Users' Legal Rights From Anti-Circumvention Law. +

+

No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. +

+

When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. +

+

4. Conveying Verbatim Copies. +

+

You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. +

+

You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. +

+

5. Conveying Modified Source Versions. +

+

You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: +

+
    +
  1. The work must carry prominent notices stating that you modified + it, and giving a relevant date. +
  2. The work must carry prominent notices stating that it is + released under this License and any conditions added under section +
  3. This requirement modifies the requirement in section 4 to + "keep intact all notices". +
  4. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +
  5. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. +
+

A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. +

+

6. Conveying Non-Source Forms. +

+

You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: +

+
    +
  1. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +
  2. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. +
  3. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +
  4. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +
  5. Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. +
+

A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. +

+

A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. +

+

"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. +

+

If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). +

+

The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. +

+

Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. +

+

7. Additional Terms. +

+

"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. +

+

When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. +

+

Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: +

+
    +
  1. Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +
  2. Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +
  3. Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +
  4. Limiting the use for publicity purposes of names of licensors or + authors of the material; or +
  5. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +
  6. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. +
+

All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. +

+

If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. +

+

Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. +

+

8. Termination. +

+

You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). +

+

However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. +

+

Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

+

Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. +

+

9. Acceptance Not Required for Having Copies. +

+

You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. +

+

10. Automatic Licensing of Downstream Recipients. +

+

Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. +

+

An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. +

+

You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. +

+

11. Patents. +

+

A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". +

+

A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. +

+

Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. +

+

In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. +

+

If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +

If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. +

+

A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. +

+

Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. +

+

12. No Surrender of Others' Freedom. +

+

If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. +

+

13. Use with the GNU Affero General Public License. +

+

Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. +

+

14. Revised Versions of this License. +

+

The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. +

+

If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. +

+

Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. +

+

15. Disclaimer of Warranty. +

+

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +

+

16. Limitation of Liability. +

+

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. +

+

17. Interpretation of Sections 15 and 16. +

+

If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. +

+

END OF TERMS AND CONDITIONS +

+

How to Apply These Terms to Your New Programs +

+

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> +

+

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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: +

+

<program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". +

+

You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. +

+

The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

fakeroot: COPYING file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The GNU General Public License is a free, copyleft license for +software and other kinds of works. +

+

The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. +

+

To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. +

+

Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. +

+

For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. +

+

Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. +

+

Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. +

+

The precise terms and conditions for copying, distribution and +modification follow. +

+

TERMS AND CONDITIONS +

+

0. Definitions. +

+

"This License" refers to version 3 of the GNU General Public License. +

+

"Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +

"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. +

+

To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. +

+

A "covered work" means either the unmodified Program or a work based +on the Program. +

+

To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. +

+

To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. +

+

An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. +

+
    +
  1. Source Code. +
+

The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. +

+

A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. +

+

The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. +

+

The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. +

+

The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. +

+

The Corresponding Source for a work in source code form is that +same work. +

+

2. Basic Permissions. +

+

All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. +

+

You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. +

+

Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. +

+

3. Protecting Users' Legal Rights From Anti-Circumvention Law. +

+

No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. +

+

When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. +

+

4. Conveying Verbatim Copies. +

+

You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. +

+

You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. +

+

5. Conveying Modified Source Versions. +

+

You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: +

+
    +
  1. The work must carry prominent notices stating that you modified + it, and giving a relevant date. +
  2. The work must carry prominent notices stating that it is + released under this License and any conditions added under section +
  3. This requirement modifies the requirement in section 4 to + "keep intact all notices". +
  4. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +
  5. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. +
+

A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. +

+

6. Conveying Non-Source Forms. +

+

You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: +

+
    +
  1. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +
  2. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. +
  3. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +
  4. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +
  5. Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. +
+

A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. +

+

A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. +

+

"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. +

+

If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). +

+

The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. +

+

Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. +

+

7. Additional Terms. +

+

"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. +

+

When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. +

+

Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: +

+
    +
  1. Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +
  2. Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +
  3. Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +
  4. Limiting the use for publicity purposes of names of licensors or + authors of the material; or +
  5. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +
  6. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. +
+

All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. +

+

If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. +

+

Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. +

+

8. Termination. +

+

You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). +

+

However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. +

+

Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

+

Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. +

+

9. Acceptance Not Required for Having Copies. +

+

You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. +

+

10. Automatic Licensing of Downstream Recipients. +

+

Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. +

+

An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. +

+

You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. +

+

11. Patents. +

+

A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". +

+

A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. +

+

Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. +

+

In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. +

+

If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +

If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. +

+

A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. +

+

Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. +

+

12. No Surrender of Others' Freedom. +

+

If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. +

+

13. Use with the GNU Affero General Public License. +

+

Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. +

+

14. Revised Versions of this License. +

+

The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. +

+

If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. +

+

Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. +

+

15. Disclaimer of Warranty. +

+

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +

+

16. Limitation of Liability. +

+

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. +

+

17. Interpretation of Sections 15 and 16. +

+

If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. +

+

END OF TERMS AND CONDITIONS +

+

How to Apply These Terms to Your New Programs +

+

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> +

+

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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: +

+

<program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". +

+

You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. +

+

The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

module-init-tools: COPYING file +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+

Copyright (C) 1989, 1991 Free Software Foundation, Inc. +

59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. + +


+ +

GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +

+

0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+

Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

+
    +
  1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +
+

You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+
    +
  1. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +
  2. You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +
  3. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +
    + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +
+

Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+

In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

+

3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

+
    +
  1. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +
  2. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
  3. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+

The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+

If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +


+ + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +

5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

+

6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

+

7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+

If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+

It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+

This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +


+ + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +

9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

+

10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

+

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITIONS + +


+ + How to Apply These Terms to Your New Programs + +

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> +

+

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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: +

+

Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. +

+

You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: +

+

Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. +

+

<signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice +

+

This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

uboot-tools: COPYING file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+

U-Boot is Free Software. It is copyrighted by Wolfgang Denk and +many others who contributed code (see the actual source code for +details). You can redistribute U-Boot and/or modify it under the +terms of version 2 of the GNU General Public License as published by +the Free Software Foundation. Most of it can also be distributed, +at your option, under any later version of the GNU General Public +License -- see individual files for exceptions. +

+

NOTE! This license does not cover the so-called "standalone" +applications that use U-Boot services by means of the jump table +provided by U-Boot exactly for this purpose - this is merely +considered normal use of U-Boot, and does not fall under the +heading of "derived work". +

+

The header files "include/image.h" and "include/asm-*/u-boot.h" +define interfaces to U-Boot. Including these (unmodified) header +files in another file is considered normal use of U-Boot, and does +not fall under the heading of "derived work". +

+

Also note that the GPL below is copyrighted by the Free Software +Foundation, but the instance of code that it refers to (the U-Boot +source code) is copyrighted by me and others who actually wrote it. +-- Wolfgang Denk +

+
+ +
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+

Copyright (C) 1989, 1991 Free Software Foundation, Inc. +

59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. + +


+ +

GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +

+

0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+

Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

+
    +
  1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +
+

You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+
    +
  1. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +
  2. You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +
  3. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +
    + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +
+

Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+

In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

+

3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

+
    +
  1. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +
  2. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
  3. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+

The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+

If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +


+ + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +

5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

+

6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

+

7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+

If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+

It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+

This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +


+ + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +

9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

+

10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

+

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITIONS +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

autoconf: COPYINGv3 file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The GNU General Public License is a free, copyleft license for +software and other kinds of works. +

+

The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. +

+

To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. +

+

Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. +

+

For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. +

+

Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. +

+

Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. +

+

The precise terms and conditions for copying, distribution and +modification follow. +

+

TERMS AND CONDITIONS +

+

0. Definitions. +

+

"This License" refers to version 3 of the GNU General Public License. +

+

"Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. +

+

"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. +

+

To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. +

+

A "covered work" means either the unmodified Program or a work based +on the Program. +

+

To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. +

+

To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. +

+

An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. +

+
    +
  1. Source Code. +
+

The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. +

+

A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. +

+

The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. +

+

The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. +

+

The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. +

+

The Corresponding Source for a work in source code form is that +same work. +

+

2. Basic Permissions. +

+

All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. +

+

You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. +

+

Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. +

+

3. Protecting Users' Legal Rights From Anti-Circumvention Law. +

+

No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. +

+

When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. +

+

4. Conveying Verbatim Copies. +

+

You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. +

+

You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. +

+

5. Conveying Modified Source Versions. +

+

You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: +

+
    +
  1. The work must carry prominent notices stating that you modified + it, and giving a relevant date. +
  2. The work must carry prominent notices stating that it is + released under this License and any conditions added under section +
  3. This requirement modifies the requirement in section 4 to + "keep intact all notices". +
  4. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +
  5. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. +
+

A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. +

+

6. Conveying Non-Source Forms. +

+

You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: +

+
    +
  1. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +
  2. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. +
  3. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +
  4. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +
  5. Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. +
+

A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. +

+

A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. +

+

"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. +

+

If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). +

+

The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. +

+

Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. +

+

7. Additional Terms. +

+

"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. +

+

When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. +

+

Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: +

+
    +
  1. Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +
  2. Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +
  3. Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +
  4. Limiting the use for publicity purposes of names of licensors or + authors of the material; or +
  5. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +
  6. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. +
+

All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. +

+

If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. +

+

Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. +

+

8. Termination. +

+

You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). +

+

However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. +

+

Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

+

Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. +

+

9. Acceptance Not Required for Having Copies. +

+

You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. +

+

10. Automatic Licensing of Downstream Recipients. +

+

Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. +

+

An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. +

+

You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. +

+

11. Patents. +

+

A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". +

+

A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. +

+

Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. +

+

In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. +

+

If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. +

+

If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. +

+

A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. +

+

Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. +

+

12. No Surrender of Others' Freedom. +

+

If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. +

+

13. Use with the GNU Affero General Public License. +

+

Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. +

+

14. Revised Versions of this License. +

+

The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. +

+

If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. +

+

Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. +

+

15. Disclaimer of Warranty. +

+

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +

+

16. Limitation of Liability. +

+

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. +

+

17. Interpretation of Sections 15 and 16. +

+

If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. +

+

END OF TERMS AND CONDITIONS +

+

How to Apply These Terms to Your New Programs +

+

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> +

+

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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: +

+

<program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". +

+

You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. +

+

The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

autoconf: COPYING.EXCEPTION file +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                   AUTOCONF CONFIGURE SCRIPT EXCEPTION
+                       Version 3.0, 18 August 2009
+
+

Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

This Exception is an additional permission under section 7 of the GNU +General Public License, version 3 ("GPLv3"). It applies to a given +file that bears a notice placed by the copyright holder of the file +stating that the file is governed by GPLv3 along with this Exception. +

+

The purpose of this Exception is to allow distribution of Autoconf's +typical output under terms of the recipient's choice (including +proprietary). +

+

0. Definitions +

+

"Covered Code" is the source or object code of a version of Autoconf +that is a covered work under this License. +

+

"Normally Copied Code" for a version of Autoconf means all parts of +its Covered Code which that version can copy from its code (i.e., not +from its input file) into its minimally verbose, non-debugging and +non-tracing output. +

+

"Ineligible Code" is Covered Code that is not Normally Copied Code. +

+
    +
  1. Grant of Additional Permission. +
+

You have permission to propagate output of Autoconf, even if such +propagation would otherwise violate the terms of GPLv3. However, if +by modifying Autoconf you cause any Ineligible Code of the version you +received to become Normally Copied Code of your modified version, then +you void this Exception for the resulting covered work. If you convey +that resulting covered work, you must remove this Exception in accordance +with the second paragraph of Section 7 of GPLv3. +

+

2. No Weakening of Autoconf Copyleft. +

+

The availability of this Exception does not imply any general presumption +that third-party software is unaffected by the copyleft requirements of +the license of Autoconf. +

+

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

automake: COPYING file
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +

+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+

Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +

+

Preamble +

+

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. +

+

GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +

+

0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+

Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

+
    +
  1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +
+

You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+
    +
  1. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +
  2. You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +
  3. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +
+

These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +

+

Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+

In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

+

3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

+
    +
  1. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +
  2. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
  3. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+

The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+

If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. +

+

4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. +

+

5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

+

6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

+

7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+

If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+

It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+

This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. +

+

8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. +

+

9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+

Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

+

10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

+

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITIONS +

+

How to Apply These Terms to Your New Programs +

+

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

+

<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> +

+

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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +

+

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

+

You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +

+

Also add information on how to contact you by electronic and paper mail. +

+

If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: +

+

Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +

+

The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. +

+

You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: +

+

Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. +

+

<signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice +

+

This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. +

+ +
+
 
+ + + diff --git a/octoserve/var/www/lnbsettings.html b/octoserve/var/www/lnbsettings.html new file mode 100644 index 0000000..71bd7fe --- /dev/null +++ b/octoserve/var/www/lnbsettings.html @@ -0,0 +1,381 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + +
+ DD +
 
+
+ + + + + + + + +
Enable manual LNB configuration +
+ +
+
+
+
+ + +
+
+
+ +
+

Automatic LNB Selection

+
  • Ku Band: Universal LNB
  • + +
    + +
    +

    Manual LNB Selection

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Tuner   +
    + +
    +
     (empty for all)
    Source   +
    + +
    +
     (empty for all)
    LOF low   +
    + +
    +
     MHz
    LOF high   +
    + +
    +
     MHz (empty for unused)
    LOF switch   +
    + +
    +
     MHz (empty for unused)
    +
    + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    LNBTunerSourceLOF lowLOF highLOF switch 
    +
    + + + + + + + +
    +
     
    + + + diff --git a/octoserve/var/www/lnbsettings.lua b/octoserve/var/www/lnbsettings.lua new file mode 100644 index 0000000..ea4b2b2 --- /dev/null +++ b/octoserve/var/www/lnbsettings.lua @@ -0,0 +1,185 @@ +#!/usr/bin/lua + +function SaveOctoserveConf(Section,Values) + local ConfStart = "" + local f = io.open("/config/octoserve.conf","r") + local line + if f then + while true do + while true do + line = f:read() + if not line then break end + if string.match(line,"^%["..Section.."%]") then break end + ConfStart = ConfStart .. line .. "\n" + end + while true do + line = f:read() + if not line then break end + if not string.match(line,"^%["..Section.."%]") then + if string.match(line,"^%[%w+%]") then + ConfStart = ConfStart .. line .. "\n" + break + end + end + end + if not line then break end + end + f:close() + os.remove("/config/octoserve.bak") + os.rename("/config/octoserve.conf","/config/octoserve.bak") + end + + f = io.open("/config/octoserve.conf","w") + if ConfStart then + f:write(ConfStart) + end + f:write(Values) + f:close() +end + +function LoadOctoserveConf(Section) + local f = io.open("/config/octoserve.conf","r") + local line + local Sections = {} + local curSection = {} + if f then + while true do + while true do + line = f:read() + if not line then break end + if string.match(line,"^%["..Section.."%]") then + break + end + end + while true do + line = f:read() + if not line then break end + if string.match(line,"^%["..Section.."%]") then + if #curSection > 0 then + table.insert(Sections,curSection) + curSection = {} + end + else + if string.match(line,"^%[%w+%]") then + break + else + if #line > 0 and not string.match(line,"^%#") then + table.insert(curSection,line) + end + end + end + end + if #curSection > 0 then + table.insert(Sections,curSection) + curSection = {} + end + if not line then break end + end + f:close() + end + return Sections +end + + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +if arg[1] then + query = arg[1] + if query == "get" then query = "" end + proto = "HTTP/1.0" + host = "local" +end + +if query ~= "" then + local nextloc = "wait.html?5" + local params = io.stdin:read("*a") + local p,v + local auto = false + local conf = "" + + -- print(proto.." 200") + -- print("Pragma: no-cache") + -- print("Content-Type: text/plain") + -- print("") + + print(proto.." 303") + print("Location: http://"..host.."/"..nextloc) + print("") + + for p,v in string.gmatch(params,"(%a+)=([0123456789%.]+)") do + print(p,v) + if p == "auto" and p == "1" then + auto = true + break + end + if p == "LNB" then + local lnb,tuner,source,lof1,lof2,lofs = string.match(v,"(%d+)%.(%d+)%.(%d+)%.(%d+)%.(%d+)%.(%d+)") + + conf = conf .. "[LNB]\n" + conf = conf .. "#\n# LNB " .. lnb .. " Setting\n#\n" + if tuner > "0" then conf = conf .. string.format("Tuner=%d\n",tuner) end + if source > "0" then conf = conf .. string.format("Source=%d\n",source) end + conf = conf .. string.format("LOF1=%d\n",lof1) + if lof2 > "0" then conf = conf .. string.format("LOF2=%d\n",lof2) end + if lofs > "0" then conf = conf .. string.format("LOFS=%d\n",lofs) end + conf = conf .. "\n" + + end + end + + SaveOctoserveConf("LNB",conf) + os.execute("/etc/init.d/S99octo restartoctoserve&") +else + + print(proto.." 200") + print("Pragma: no-cache") + print("Content-Type: application/x-javascript") + print("") + + print("LNBList = new Array();") + + local i,lnb + local Conf = LoadOctoserveConf("LNB") + + i = 0 + for _,lnb in pairs(Conf) do + local Tuner = 0 + local Source = 0 + local LOF1 = 0 + local LOF2 = 0 + local LOFS = 0 + + for _,line in pairs(lnb) do + local n,v = string.match(line,"%s-(%w+)%s-=%s-(%d+)") + if n == "Tuner" then Tuner = v end + if n == "Source" then Source = v end + if n == "LOF1" then LOF1 = v end + if n == "LOF2" then LOF2 = v end + if n == "LOFS" then LOFS = v end + print("// " .. n .. " = " .. v); + end + + print(string.format("LNBList[%d] = new Object();" ,i)) + print(string.format("LNBList[%d].Tuner = %d;" ,i,Tuner )) + print(string.format("LNBList[%d].Source = %d;" ,i,Source)) + print(string.format("LNBList[%d].LOF1 = %d;" ,i,LOF1 )) + print(string.format("LNBList[%d].LOF2 = %d;" ,i,LOF2 )) + print(string.format("LNBList[%d].LOFS = %d;" ,i,LOFS )) + + + i = i + 1 + end + + -- print("LNBList[0] = new Object();") + -- print("LNBList[0].Tuner = 0;") + -- print("LNBList[0].Source = 0;") + -- print("LNBList[0].LOF1 = 9750;") + -- print("LNBList[0].LOF2 = 10600;") + -- print("LNBList[0].LOFS = 11700;") + + +end + + diff --git a/octoserve/var/www/ltest.lua b/octoserve/var/www/ltest.lua new file mode 100644 index 0000000..1096802 --- /dev/null +++ b/octoserve/var/www/ltest.lua @@ -0,0 +1,25 @@ +#!/usr/bin/lua + +-- HTTP header +print [[ +Content-Type: text/plain +Set-Cookie: foo=bar +Set-Cookie: wonder=always + +]] + +-- body of page + +-- find all environment variables using bash and a temporary file + +fname = os.tmpname () +os.execute ("/bin/sh -c set > " .. fname) +f = io.open (fname, "r") -- open it +s = f:read ("*a") -- read all of it +print (s) +f:close () -- close it +os.remove (fname) + +print("") +params = io.stdin:read("*a") +print(params) \ No newline at end of file diff --git a/octoserve/var/www/mclist.lua b/octoserve/var/www/mclist.lua new file mode 100644 index 0000000..5e8c13f --- /dev/null +++ b/octoserve/var/www/mclist.lua @@ -0,0 +1,107 @@ +#!/usr/bin/lua + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") +local method = os.getenv("REQUEST_METHOD") +local clength = os.getenv("CONTENT_LENGTH") +local ctype = os.getenv("CONTENT_TYPE") + +function http_print(s) + if s then + io.stdout:write(tostring(s).."\r\n") + else + io.stdout:write("\r\n") + end +end + +function GetDevID() + local devid = nil + local tmp = io.open("/config/device.id") + if tmp then + devid = tonumber(tmp:read()) + tmp:close() + end + return devid +end + +function ReadList() + local list = {} + local devid = GetDevID() + if not devid then return nil end + local file = io.open("/config/mcsetup.csv","r") + if file then + local line = file:read() + if line then + line = string.gsub(line,'"','') + if line:match("TITLE,REQUEST,PIDS,LANPORTS") then + local i = 1 + while i < 13 do + line = file:read() + if not line then break end + if DebugFlag then print(line) end + local title,request,pids,lanports = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"L(%a-[%d%:]-)%"') + if not title then + title,request,pids = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%"') + end + if not title or not request or not pids then + break + end + if pids == "" then break end + if lanports then + if lanports == "" then lanports = nil end + end + + table.insert(list, { title = title, ip = "239."..devid..".2."..i, port = "6670", lanports = lanports } ) + i = i + 1 + end + elseif line:match("TITLE,REQUEST,PIDS,PROTO,IP,PORT,TTL,LANPORTS") then + while true do + line = file:read() + if not line then break end + if DebugFlag then print(line) end + local title,request,pids,proto,ip,port,ttl,lanports = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"(%u%u%u)%",%"(%d*%.%d*%.%d*%.%d*)%",(%d*),(%d*),%"L(%a-[%d%:]-)%"') + if not title then + title,request,pids,proto,ip,port,ttl = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"(%u%u%u)%",%"(%d*%.%d*%.%d*%.%d*)%",(%d*),(%d*)') + end + if not title or not request or not pids then + break + end + if pids == "" then break end + if proto ~= "UDP" and proto ~= "RTP" then break end + + pids = string.gsub(pids,":",",") + if lanports then + lanports = string.gsub(lanports,":",",") + if lanports == "" then lanports = nil end + if lanports == "all" then lanports = "1,2,3,4,5" end + end + local url + table.insert(list,{ title = title, proto = proto, ip = ip, port = port,lanports = lanports }) + end + end + end + file:close() + end + + return list +end + +local mclist = ReadList() + + +http_print("HTTP/1.1 200") +http_print("Pragma: no-cache") +http_print("Content-Type: application/x-javascript") +http_print() + +http_print('Multicast = new Array();') +local i,entry +for i,entry in ipairs(mclist) do + http_print(string.format("Multicast[%d] = new Object();",i-1)) + http_print(string.format("Multicast[%d].Title = '%s';",i-1,entry.title:gsub("'","\\'"))) + http_print(string.format("Multicast[%d].Dest = '%s:%s';",i-1,entry.ip,entry.port)) + if entry.lanports then + http_print(string.format("Multicast[%d].LanPorts = '%s';",i-1,entry.lanports:gsub(":"," "))) + end +end diff --git a/octoserve/var/www/menu.js b/octoserve/var/www/menu.js new file mode 100644 index 0000000..46f43dd --- /dev/null +++ b/octoserve/var/www/menu.js @@ -0,0 +1,104 @@ + +// + +MenuItems = new Array(); + +MenuItems[0] = new Object(); +MenuItems[0].Text = "Home"; +MenuItems[0].Link = "index.html"; + +MenuItems[1] = new Object(); +MenuItems[1].Text = "Browser TV"; +MenuItems[1].Link = "browsertv.html"; + +MenuItems[2] = new Object(); +MenuItems[2].Text = "Stream Status"; +MenuItems[2].Link = "streamstatus.html"; + +MenuItems[3] = new Object(); +MenuItems[3].Text = "Tuner Status"; +MenuItems[3].Link = "tunerstatus.html"; + +MenuItems[4] = new Object(); +MenuItems[4].Text = "Unicable Settings"; +MenuItems[4].Link = "scif.html"; + +MenuItems[5] = new Object(); +MenuItems[5].Text = "LNB Settings"; +MenuItems[5].Link = "lnbsettings.html"; + +MenuItems[6] = new Object(); +MenuItems[6].Text = "System Settings"; +MenuItems[6].Link = "system.html"; + +MenuItems[7] = new Object(); +MenuItems[7].Text = "Multicast Setup"; +MenuItems[7].Link = "multicast.html"; + +MenuItems[8] = new Object(); +MenuItems[8].Text = "Channel Lists"; +MenuItems[8].Link = "channellists.html"; + +MenuItems[9] = new Object(); +MenuItems[9].Text = "Update"; +MenuItems[9].Link = "update.html"; + +MenuItems[10] = new Object(); +MenuItems[10].Text = "Reboot"; +MenuItems[10].Link = "reboot.html"; + +MenuItems[11] = new Object(); +MenuItems[11].Text = "Licenses"; +MenuItems[11].Link = "licenses.html"; + +// add additional items here + +// --------------------------------------------------------------- +// Don't touch + +function CreateMenu() +{ + document.write(''); + for(i = 0; i < MenuItems.length; i++ ) + { + if( document.URL.indexOf(MenuItems[i].Link) < 0 ) + document.write(''); + else + document.write(''); + } + document.write(''); +} + +// -------------------------------------------------------------- + +var browserType = "unk"; +var browserLanguage = "en"; +var browserPlatform = "unk"; + +if( navigator.appVersion.indexOf("MSIE") >= 0 ) + browserType = "MSIE"; +else + browserType = "Netscape"; + +if( browserType == "MSIE" ) + browserLanguage = navigator.browserLanguage.substr(0,2); +else if( browserType == "Netscape" ) +{ + var nplat = navigator.platform.toLowerCase(); + browserLanguage = navigator.language.substr(0,2); + if( nplat.indexOf("win") == 0 ) + browserPlatform = "win"; + else if( nplat.indexOf("linux") >= 0 ) + browserPlatform = "linux"; + else if( nplat.indexOf("ipad") >= 0 ) + browserPlatform = "ipad"; +} + +// document.write(navigator.appName); +// document.write(navigator.appVersion); +// document.write(navigator.browserLanguage); +// document.write(navigator.language); +// document.write(navigator.platform); +// document.write(navigator.mimeTypes.length); +// document.write(navigator.plugins.length); +// document.write(window.ActiveXObject ? "AX" : "no AX"); diff --git a/octoserve/var/www/multicast.html b/octoserve/var/www/multicast.html new file mode 100644 index 0000000..e89fe38 --- /dev/null +++ b/octoserve/var/www/multicast.html @@ -0,0 +1,160 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + +

    Static Multicast Setup

    +
    + + + + + + + + +
    StreamTitleDestinationLan-Ports
    +

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Current Settings + +
    + + +
    +
    + M3U List + +
    + + +
    +
    + Samples + +
    + + + +
    +
    + Select Sample + +
    + + + +
    +
     
    +
    + + +
    +
     
    +
    + + +
    +
    + +
    +
     
    + + + diff --git a/octoserve/var/www/multicast.lua b/octoserve/var/www/multicast.lua new file mode 100644 index 0000000..6949f61 --- /dev/null +++ b/octoserve/var/www/multicast.lua @@ -0,0 +1,224 @@ +#!/usr/bin/lua + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") +local method = os.getenv("REQUEST_METHOD") +local clength = os.getenv("CONTENT_LENGTH") +local ctype = os.getenv("CONTENT_TYPE") + +function http_print(s) + if s then + io.stdout:write(tostring(s).."\r\n") + else + io.stdout:write("\r\n") + end +end + +if #arg> 0 then + method="GET" + query="select=m3u" + proto = "HTTP/1.0" +end + +function SendError(err,desc) + http_print(proto.." "..err) + http_print() + local file = io.open("e404.html") + if file then + local tmp = file:read("*a") + tmp = string.gsub(tmp,"404 Not Found",err .. " " .. desc) + http_print(tmp) + file:close() + end +end + +function GetDevID() + local devid = nil + local tmp = io.open("/config/device.id") + if tmp then + devid = tonumber(tmp:read()) + tmp:close() + end + return devid +end + +function CreateM3U() + local m3u = nil + local devid = GetDevID() + if not devid then return nil end + local file = io.open("/config/mcsetup.csv","r") + if file then + local line = file:read() + if line then + line = string.gsub(line,'"','') + if string.match(line,"TITLE,REQUEST,PIDS,LANPORTS") then + local i = 1 + m3u = "#EXTM3U".."\n" + while i < 13 do + line = file:read() + if not line then break end + if DebugFlag then print(line) end + local title,request,pids,lanports = string.match(line,'%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"L(%a-[%d%:]-)%"') + if not title then + title,request,pids = string.match(line,'%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%"') + end + if not title or not request or not pids then + break + end + if pids == "" then break end + + m3u = m3u .. "#EXTINF:0,"..title.."\n" + .. "rtp://239."..devid..".2."..i..":6670\n" + i = i + 1 + end + elseif line:match("TITLE,REQUEST,PIDS,PROTO,IP,PORT,TTL,LANPORTS") then + local i = 1 + m3u = "#EXTM3U".."\n" + while i < 13 do + line = file:read() + if not line then break end + if DebugFlag then print(line) end + local title,request,pids,proto,ip,port,ttl,lanports = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"(%u%u%u)%",%"(%d*%.%d*%.%d*%.%d*)%",(%d*),(%d*),%"L(%a-[%d%:]-)%"') + if not title then + title,request,pids,proto,ip,port,ttl = line:match('%"(.*)%",%"(.*)%",%"P(%a-[%d%:]-)%",%"(%u%u%u)%",%"(%d*%.%d*%.%d*%.%d*)%",(%d*),(%d*)') + end + if not title or not request or not pids then + break + end + + if pids == "" then break end + if proto ~= "UDP" and proto ~= "RTP" then break end + if proto == "UDP" then ip = "@"..ip end + + m3u = m3u .. "#EXTINF:0,"..title.."\n" + .. proto:lower() .. "://"..ip..":"..port.."\n" + i = i + 1 + end + end + end + file:close() + end + + return m3u +end + +if method == "GET" then + local path = nil + local disposition = nil + local subtype="csv" + + if string.match(query,"select=sample") then + local name = string.match(query,"name=(%w+)") + if name then + path = "/var/mcsetup/"..name..".csv" + disposition = name..".csv" + else + SendError("404","Request Error") + return + end + elseif string.match(query,"select=current") then + path = "/config/mcsetup.csv" + disposition = "mcsetup.csv" + elseif string.match(query,"select=m3u") then + path = "m3u" + disposition = "mclist.m3u" + subtype = "m3u" + elseif string.match(query,"select=copy") then + local name = string.match(query,"name=(%w+)") + if name then + path = "/var/mcsetup/"..name..".csv" + disposition = "copy" + else + SendError("404","Request Error") + return + end + elseif string.match(query,"select=disable") then + disposition = "disable" + end + + if disposition == "disable" then + os.remove("/config/mcsetup.csv") + os.execute('echo "1" >/tmp/mc.tmp;mv -f /tmp/mc.tmp /tmp/mc.signal'); + http_print(proto.." 303") + http_print("Location: http://"..host.."/multicast.html") + http_print("") + return + end + + if disposition == "copy" then + os.execute("cp "..path.." /config/mcsetup.csv") + os.execute('echo "1" >/tmp/mc.tmp;mv -f /tmp/mc.tmp /tmp/mc.signal'); + http_print(proto.." 303") + http_print("Location: http://"..host.."/multicast.html") + http_print() + return + end + + local data = nil + if path == "m3u" then + data = CreateM3U() + else + local tmp = io.open(path,"r") + if tmp then + data = tmp:read("*a") + tmp:close() + end + + end + + if data then + http_print(proto.." 200" ) + http_print("Pragma: no-cache") + http_print("Content-Type: text/"..subtype) + http_print('Content-Disposition: filename="'..disposition..'"') + http_print(string.format("Content-Length: %d",#data)) + http_print() + http_print(data) + else + SendError("404",disposition.." not found") + end + +elseif method == "POST" and clength and ctype then + + if not string.match(ctype,"multipart/form%-data") then + SendError("404","??") + return + end + + local boundary = string.match(ctype,"boundary=(.*)") + if not boundary then + SendError("404","???") + return + end + + while true do + local line = io.stdin:read() + line = string.gsub(line,"\r","") + if line == "" then break end + end + + data = io.stdin:read(16384) + data = string.sub(data,1,#data - #boundary - 4) + if data:match("^\239\187\191") then data = data:sub(4) end + + data = string.gsub(data,"\r\n","\n") -- Windows -> Unix + data = string.gsub(data,"\r","\n") -- MAC -> Unix + + -- if data:match("^TITLE,REQUEST,PIDS,PROTO,IP,PORT,TTL,LANPORTS") then + if data:match("^TITLE,REQUEST,PIDS,LANPORTS") or data:match("^TITLE,REQUEST,PIDS,PROTO,IP,PORT,TTL,LANPORTS") then + file = io.open("/config/mcsetup.csv","w") + if file then + file:write(data) + file:close() + os.execute('echo "1" >/tmp/mc.tmp;mv -f /tmp/mc.tmp /tmp/mc.signal'); + end + end + + http_print(proto.." 303") + http_print("Location: http://"..host.."/multicast.html") + http_print() + +else + SendError("500","What") +end diff --git a/octoserve/var/www/reboot.html b/octoserve/var/www/reboot.html new file mode 100644 index 0000000..2fc65e0 --- /dev/null +++ b/octoserve/var/www/reboot.html @@ -0,0 +1,129 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + + + + + + + + + + + + + + +
      
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    +
     
    + + + diff --git a/octoserve/var/www/reboot.lua b/octoserve/var/www/reboot.lua new file mode 100644 index 0000000..c885e2a --- /dev/null +++ b/octoserve/var/www/reboot.lua @@ -0,0 +1,34 @@ +#!/usr/bin/lua + + +print("HTTP/1.0 200 ") +print("Pragma: no-cache") +print("Content-Type: application/x-javascript") +print("") + +local query = os.getenv("QUERY_STRING") + +if( query == "sjiwjsiowjs" ) then + print("Rebooting = true") + local uImage = io.open("/boot/uImage") + if( uImage ) then + uImage:close() + else + -- Cleanup server home + os.execute("rm -rf /var/www/*") + os.execute("rm -rf /var/dms/*") + os.execute("rm -rf /var/channels/*") + end + + os.execute("/etc/init.d/S99octo stop") + os.execute("sync") + os.execute("reboot") +elseif( query == "restart_octo" ) then + print("Rebooting = true") + os.execute("/etc/init.d/S99octo restartoctonet") +elseif( query == "restart_dms" ) then + print("Rebooting = true") + os.execute("/etc/init.d/S92dms restart") +else + print("Rebooting = false") +end diff --git a/octoserve/var/www/scif.html b/octoserve/var/www/scif.html new file mode 100644 index 0000000..2ccce54 --- /dev/null +++ b/octoserve/var/www/scif.html @@ -0,0 +1,305 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
    + + Enable Unicable (EN 50494) + +
    +
    Manufacturer +
    + +
    +
    Unit +
    + +
    +
    Tuner 1 +
    + +
    +
    Tuner 2 +
    + +
    +
    Tuner 3 +
    + +
    +
    Tuner 4 +
    + +
    +
    Tuner 5 +
    + +
    +
    Tuner 6 +
    + +
    +
    Tuner 7 +
    + +
    +
    Tuner 8 +
    + +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
     
    + + + diff --git a/octoserve/var/www/scifdb.lua b/octoserve/var/www/scifdb.lua new file mode 100644 index 0000000..1bd609c --- /dev/null +++ b/octoserve/var/www/scifdb.lua @@ -0,0 +1,85 @@ +#!/usr/bin/lua + +local SLAXML = require 'slaxdom' +local SCIFDataBase = io.open('SCIFDataBase.xml'):read("*a") +-- SLAXML:parse(SCIFDataBase,{stripWhitespace=true}) +local dom = SLAXML:dom(SCIFDataBase,{ simple=false,stripWhitespace=true }) + +local child +local unit + +local i +local j +local k +local l +local Frequency + +local ManufacturerList = {} +local ManufacturerArray = {} +local ManufacturerCount = 0 + +for i,child in ipairs(dom.kids) do + print (i,child.name) + if child.name == "SCIFDataBase" then + for j,unit in ipairs(child.kids) do + if unit.name == "OutdoorUnit" then + local Name = unit.attr["Name"]; + local Manufacturer = unit.attr["Manufacturer"]; + local Type = unit.attr["Type"]; + local Protocol = unit.attr["Protocol"]; + if not Protocol then Protocol = "" end + if not Manufacturer then Manufacturer = "" end + if not Type then Type = "LNB" end + -- print ( " ",Name,Manufacturer,Type) + local CurManu = ManufacturerList[Manufacturer] + if not CurManu then + CurManu = { UnitList = {}, UnitCount = 0, Name = Manufacturer } + ManufacturerCount = ManufacturerCount + 1 + ManufacturerList[Manufacturer] = CurManu + ManufacturerArray[ManufacturerCount] = CurManu + end + CurManu.UnitCount = CurManu.UnitCount + 1 + local CurUnit = { Name = Name, Type = Type, Frequencies = {} } + CurManu.UnitList[CurManu.UnitCount] = CurUnit + local fcount = 0 + for k,Frequency in ipairs(unit.kids) do + if Frequency.name == "UBSlot" then + fcount = fcount + 1 + CurUnit.Frequencies[fcount] = Frequency.attr["Frequency"] + + -- print(" -------------------------", Frequency.type, Frequency.name, Frequency.attr["Frequency"]) + end + end + end + end + end +end + +-- print(ManufacturerCount) + +print("HTTP/1.1 200 ") +print("Pragma: no-cache") +print("Content-Type: application/x-javascript") +print("") + +print("ManufacturerList = new Array();") + +for i,CurManu in ipairs(ManufacturerArray) do + print("") + print(string.format("ManufacturerList[%d] = new Object();",i-1)) + print(string.format("ManufacturerList[%d].Name = \"%s\";",i-1,CurManu.Name)) + print(string.format("ManufacturerList[%d].UnitList = new Array();",i-1)) + + for j,CurUnit in ipairs(CurManu.UnitList) do + print("") + print(string.format("ManufacturerList[%d].UnitList[%d] = new Object();",i-1,j-1)) + print(string.format("ManufacturerList[%d].UnitList[%d].Name = \"%s\";",i-1,j-1,CurUnit.Name)) + print(string.format("ManufacturerList[%d].UnitList[%d].Frequencies = new Array();",i-1,j-1)) + for k,Frequency in ipairs(CurUnit.Frequencies) do + print(string.format("ManufacturerList[%d].UnitList[%d].Frequencies[%d] = %d;",i-1,j-1,k-1,Frequency)) + end + end + + i = i + 1 +end +print("") \ No newline at end of file diff --git a/octoserve/var/www/scifsettings.lua b/octoserve/var/www/scifsettings.lua new file mode 100644 index 0000000..aa9d05e --- /dev/null +++ b/octoserve/var/www/scifsettings.lua @@ -0,0 +1,137 @@ +#!/usr/bin/lua + +function SaveOctoserveConf(Section,Values) + local ConfStart = "" + local ConfEnd = "" + local f = io.open("/config/octoserve.conf","r") + if f then + while true do + line = f:read() + if not line then break end + if string.match(line,"^%["..Section.."%]") then break end + ConfStart = ConfStart .. line .. "\n" + end + while true do + line = f:read() + if not line then break end + if string.match(line,"^%[%w+%]") then + ConfEnd = ConfEnd .. line .. "\n" + break + end + end + while true do + line = f:read() + if not line then break end + ConfEnd = ConfEnd .. line .. "\n" + end + f:close() + os.remove("/config/octoserve.bak") + os.rename("/config/octoserve.conf","/config/octoserve.bak") + end + + f = io.open("/config/octoserve.conf","w") + if ConfStart then + f:write(ConfStart) + end + f:write("["..Section.."]\n") + f:write(Values) + if ConfEnd then + f:write(ConfEnd) + end + f:close() +end + +function LoadOctoserveConf(Section) + local f = io.open("/config/octoserve.conf","r") + local Values = {} + local line + if f then + while true do + line = f:read() + if not line then break end + if string.match(line,"^%["..Section.."%]") then break end + end + while true do + line = f:read() + if not line then break end + if string.match(line,"^%[%w+%]") then break end + if not string.match(line,"^%#") then + table.insert(Values,line) + end + end + f:close() + end + return(Values) +end + + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +if query ~= "" then + + print(proto.." 303") + print("Location: http://"..host.."/wait.html?5") + print("") + + -- print(string.format("Set Unicable %s", query )) + + local Values = "" + + Values = Values.."# SCIF Settings\n" + Values = Values.."# Manufacturer = nn : Index to selected manaufacturer (only used in config webpage)\n" + Values = Values.."# Unit = nn : Index to selected unit (only used in config webpage)\n" + Values = Values.."# Type = nn : Type of unit: 1: EN 50494, 2: TS 50607\n" + Values = Values.."# TunerN = Slot,Frequency[,Pin] Slot = 1..nn, Frequency = 950..2150, Pin = 0-255\n" + Values = Values.."# Slot = 0 (no SCIF)\n" + Values = Values.."# Slot = 1..8 for EN 50494, 1..32 for TS 50607\n" + + if query ~= "reset" then + local params = {} + for w in string.gmatch(query,"(%u%w+%=%d+%,?%d*%,?%d*)") do + table.insert(params,w) + end + + -- TODO: More validation + for _,v in ipairs(params) do + Values = Values..v.."\n" + end + else + Values = Values.."Type=0\n" + Values = Values.."Tuner1=0\n" + Values = Values.."Tuner2=0\n" + Values = Values.."Tuner3=0\n" + Values = Values.."Tuner4=0\n" + Values = Values.."Tuner5=0\n" + Values = Values.."Tuner6=0\n" + Values = Values.."Tuner7=0\n" + Values = Values.."Tuner8=0\n" + end + + SaveOctoserveConf("scif",Values) + os.execute("/etc/init.d/S99octo restartoctoserve&") +else + print(proto.." 200") + print("Pragma: no-cache") + print("Content-Type: application/x-javascript") + print("") + + Values = LoadOctoserveConf("scif") + + print("Tuner = new Array();") + for _,v in pairs(Values) do + name,i,v1,v2,v3 = string.match(v,"(%a+)(%d-)%=(%d+)%,?(%d*)%,?(%d*)") + + if name == "Tuner" then + print(string.format("Tuner[%d] = new Object();",i-1)) + print(string.format("Tuner[%d].Slot = %d;",i-1,v1)) + if v2 == "" then v2 = 0 end + print(string.format("Tuner[%d].Freq = %d;",i-1,v2)) + if v3 == "" then v3 = -1 end + print(string.format("Tuner[%d].Pin = %d;",i-1,v3)) + else + print( name .. " = " .. v1 .. ";" ) + end + end +end diff --git a/octoserve/var/www/slaxdom.lua b/octoserve/var/www/slaxdom.lua new file mode 100644 index 0000000..61dbe0d --- /dev/null +++ b/octoserve/var/www/slaxdom.lua @@ -0,0 +1,49 @@ +-- Optional parser that creates a flat DOM from parsing +local SLAXML = require 'slaxml' +function SLAXML:dom(xml,opts) + if not opts then opts={} end + local rich = not opts.simple + local push, pop = table.insert, table.remove + local stack = {} + local doc = { type="document", name="#doc", kids={} } + local current = doc + local builder = SLAXML:parser{ + startElement = function(name,nsURI) + local el = { type="element", name=name, kids={}, el=rich and {} or nil, attr={}, nsURI=nsURI, parent=rich and current or nil } + if current==doc then + if doc.root then error(("Encountered element '%s' when the document already has a root '%s' element"):format(name,doc.root.name)) end + doc.root = el + end + push(current.kids,el) + if current.el then push(current.el,el) end + current = el + push(stack,el) + end, + attribute = function(name,value,nsURI) + if not current or current.type~="element" then error(("Encountered an attribute %s=%s but I wasn't inside an element"):format(name,value)) end + local attr = {type='attribute',name=name,nsURI=nsURI,value=value,parent=rich and current or nil} + if rich then current.attr[name] = value end + push(current.attr,attr) + end, + closeElement = function(name) + if current.name~=name or current.type~="element" then error(("Received a close element notification for '%s' but was inside a '%s' %s"):format(name,current.name,current.type)) end + pop(stack) + current = stack[#stack] + end, + text = function(value) + if current.type~='document' then + if current.type~="element" then error(("Received a text notification '%s' but was inside a %s"):format(value,current.type)) end + push(current.kids,{type='text',name='#text',value=value,parent=rich and current or nil}) + end + end, + comment = function(value) + push(current.kids,{type='comment',name='#comment',value=value,parent=rich and current or nil}) + end, + pi = function(name,value) + push(current.kids,{type='pi',name=name,value=value,parent=rich and current or nil}) + end + } + builder:parse(xml,opts) + return doc +end +return SLAXML \ No newline at end of file diff --git a/octoserve/var/www/slaxml.lua b/octoserve/var/www/slaxml.lua new file mode 100644 index 0000000..e7bedfa --- /dev/null +++ b/octoserve/var/www/slaxml.lua @@ -0,0 +1,219 @@ +--[=====================================================================[ +v0.5.1 Copyright © 2013 Gavin Kistner ; MIT Licensed +See http://github.com/Phrogz/SLAXML for details. +--]=====================================================================] +local SLAXML = { + VERSION = "0.5.1", + _call = { + pi = function(target,content) + print(string.format("",target,content)) + end, + comment = function(content) + print(string.format("",content)) + end, + startElement = function(name,nsURI) + print(string.format("<%s%s>",name,nsURI and (" ("..nsURI..")") or "")) + end, + attribute = function(name,value,nsURI) + print(string.format(" %s=%q%s",name,value,nsURI and (" ("..nsURI..")") or "")) + end, + text = function(text) + print(string.format(" text: %q",text)) + end, + closeElement = function(name,nsURI) + print(string.format("",name)) + end, + } +} + +function SLAXML:parser(callbacks) + return { _call=callbacks or self._call, parse=SLAXML.parse } +end + +function SLAXML:parse(xml,options) + if not options then options = { stripWhitespace=false } end + + -- Cache references for maximum speed + local find, sub, gsub, char, push, pop = string.find, string.sub, string.gsub, string.char, table.insert, table.remove + local first, last, match1, match2, match3, pos2, nsURI + local pos = 1 + local state = "text" + local textStart = 1 + local currentElement={} + local currentAttributes={} + local currentAttributeCt + local nsStack = {} + + local entityMap = { ["lt"]="<", ["gt"]=">", ["amp"]="&", ["quot"]='"', ["apos"]="'" } + local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and char(s) or orig end + local function unescape(str) return gsub( str, '(&(#?)([%d%a]+);)', entitySwap ) end + + local function finishText() + if first>textStart and self._call.text then + local text = sub(xml,textStart,first-1) + if options.stripWhitespace then + text = gsub(text,'^%s+','') + text = gsub(text,'%s+$','') + if #text==0 then text=nil end + end + if text then self._call.text(unescape(text)) end + end + end + + local function findPI() + first, last, match1, match2 = find( xml, '^<%?([:%a_][:%w_.-]*) ?(.-)%?>', pos ) + if first then + finishText() + if self._call.pi then self._call.pi(match1,match2) end + pos = last+1 + textStart = pos + return true + end + end + + local function findComment() + first, last, match1 = find( xml, '^', pos ) + if first then + finishText() + if self._call.comment then self._call.comment(match1) end + pos = last+1 + textStart = pos + return true + end + end + + local function nsForPrefix(prefix) + for i=#nsStack,1,-1 do if nsStack[i][prefix] then return nsStack[i][prefix] end end + error(("Cannot find namespace for prefix %s"):format(prefix)) + end + + local function startElement() + first, last, match1 = find( xml, '^<([%a_][%w_.-]*)', pos ) + if first then + currentElement[2] = nil + finishText() + pos = last+1 + first,last,match2 = find(xml, '^:([%a_][%w_.-]*)', pos ) + if first then + currentElement[1] = match2 + currentElement[2] = nsForPrefix(match1) + match1 = match2 + pos = last+1 + else + currentElement[1] = match1 + for i=#nsStack,1,-1 do if nsStack[i]['!'] then currentElement[2] = nsStack[i]['!']; break end end + end + currentAttributeCt = 0 + push(nsStack,{}) + return true + end + end + + local function findAttribute() + first, last, match1 = find( xml, '^%s+([:%a_][:%w_.-]*)%s*=%s*', pos ) + if first then + pos2 = last+1 + first, last, match2 = find( xml, '^"([^<"]*)"', pos2 ) -- FIXME: disallow non-entity ampersands + if first then + pos = last+1 + match2 = unescape(match2) + else + first, last, match2 = find( xml, "^'([^<']*)'", pos2 ) -- FIXME: disallow non-entity ampersands + if first then + pos = last+1 + match2 = unescape(match2) + end + end + end + if match1 and match2 then + local currentAttribute = {match1,match2} + local prefix,name = string.match(match1,'^([^:]+):([^:]+)$') + if prefix then + if prefix=='xmlns' then + nsStack[#nsStack][name] = match2 + else + currentAttribute[1] = name + currentAttribute[3] = nsForPrefix(prefix) + end + else + if match1=='xmlns' then + nsStack[#nsStack]['!'] = match2 + currentElement[2] = match2 + end + end + currentAttributeCt = currentAttributeCt + 1 + currentAttributes[currentAttributeCt] = currentAttribute + return true + end + end + + local function findCDATA() + first, last, match1 = find( xml, '^', pos ) + if first then + finishText() + if self._call.text then self._call.text(match1) end + pos = last+1 + textStart = pos + return true + end + end + + local function closeElement() + first, last, match1 = find( xml, '^%s*(/?)>', pos ) + if first then + state = "text" + pos = last+1 + textStart = pos + + if self._call.startElement then self._call.startElement(unpack(currentElement)) end + if self._call.attribute then + for i=1,currentAttributeCt do self._call.attribute(unpack(currentAttributes[i])) end end + + if match1=="/" then + pop(nsStack) + if self._call.closeElement then self._call.closeElement(unpack(currentElement)) end + end + return true + end + end + + local function findElementClose() + first, last, match1, match2 = find( xml, '^', pos ) + if first then + nsURI = nil + for i=#nsStack,1,-1 do if nsStack[i]['!'] then nsURI = nsStack[i]['!']; break end end + else + first, last, match2, match1 = find( xml, '^', pos ) + if first then nsURI = nsForPrefix(match2) end + end + if first then + finishText() + if self._call.closeElement then self._call.closeElement(match1,nsURI) end + pos = last+1 + textStart = pos + pop(nsStack) + return true + end + end + + while pos<#xml do + if state=="text" then + if not (findPI() or findComment() or findCDATA() or findElementClose()) then + if startElement() then + state = "attributes" + else + first, last = find( xml, '^[^<]+', pos ) + pos = (first and last or pos) + 1 + end + end + elseif state=="attributes" then + if not findAttribute() then + if not closeElement() then + error("Was in an element and couldn't find attributes or the close.") + end + end + end + end +end + +return SLAXML \ No newline at end of file diff --git a/octoserve/var/www/stream.lua b/octoserve/var/www/stream.lua new file mode 100644 index 0000000..197d42f --- /dev/null +++ b/octoserve/var/www/stream.lua @@ -0,0 +1,16 @@ +#!/usr/bin/lua + + +print("HTTP/1.0 200\r") +print("Content-type: application/sdp\r") +print("\r") + +local query = os.getenv("QUERY_STRING") + +print("v=0\r") +print("o=- 2890844526 2890842807 IN IP4 10.0.4.31\r") +print("s=RTSP Session\r") +print("t=0 0\r") +print("m=video 0 RTP/AVP 33\r") +print("a=control:stream=1\r") +print("a=fmtp:33\r") diff --git a/octoserve/var/www/streamstatus.html b/octoserve/var/www/streamstatus.html new file mode 100644 index 0000000..358e0e3 --- /dev/null +++ b/octoserve/var/www/streamstatus.html @@ -0,0 +1,158 @@ + + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + + + + + + + + + + + + + + + + + + + + + +
    StreamStatusInputClientRTP PacketsSpeed
    + + + +
    +
     
    + + + diff --git a/octoserve/var/www/style.css b/octoserve/var/www/style.css new file mode 100644 index 0000000..bf771ec --- /dev/null +++ b/octoserve/var/www/style.css @@ -0,0 +1,78 @@ +body { + color:#000000; + background-color:#000000; + margin:0; + font-family:Arial,sans-serif; +} + +.maintable { + color:#000000; + background-color:#FFFFFF; + text-align:center; + border:0; +} + +.maintd { + vertical-align:top; +} + +.menutable { + color:#000000; + background-color:#e0e0e0; + text-align:center; + border:5px; + width:95%; + font-size:120%; +} + +.menucur { + color:#e0e0e0; + background-color:#000000; +} + +.menutable a:link { text-decoration:none; color:#000000; } +.menutable a:visited { text-decoration:none; color:#000000; } + +.content { + color:#000000; + background-color:#FFFFF0; + text-align:left; + vertical-align:top; + border:5px; + font-size:100%; +} + +.table { + color:#000000; + text-align:center; + border:1px; +} + +.tableleft { + color:#000000; + float:center; + text-align:left; + border:1px; +} + +#streamstatus { + color:#000000; + text-align:center; + border:1px; + width:90%; +} + +td#streamstatus { + color:#000080; +} + +#tunerstatus { + color:#000000; + text-align:center; + border:1px; + width:60%; +} + +a img { + border:none; +} diff --git a/octoserve/var/www/system.html b/octoserve/var/www/system.html new file mode 100644 index 0000000..53a1949 --- /dev/null +++ b/octoserve/var/www/system.html @@ -0,0 +1,168 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Layer 2 Quality of Service +
    + +
    +
    See note below
    Telnet +
    + +
    +
    Enable it at your own risk
    NODMS +
    + +
    +
    Disable DMS announcement.
    NODVBT +
    + +
    +
    Disable DVBT announcement.
    No DVB switch +
    + +
    +
    Disable DVB switch emulation on S8.
    +
    +
    + + + +
    +
    +
    +
    +

    Layer 2 Quality of Service

    + This is defined in the IEEE 802.1Q VLAN standard, and provides QoS in a local network.
    + For it to work all components in the LAN must either be transparent to it or need to support it. +
  • hubs: always transparent.
  • +
  • dumb switches: usually transparent, better ones use it to prioritise the traffic.
  • +
  • smart switches: depends on setting.
  • +
  • PCs and the like: newer systems support it by default, for older systems check the LAN adapter settings.
  • +
  • WLAN access points: depends on firmware and model. OpenWRT based devices usually work.
  • +
    + Dies ist im IEEE 802.1Q VLAN Standard definiert und erlaubt QoS im lokalem Netz.
    + Damit es funktioniert müssen alle Netzwerkkompenenten im LAN entweder transparent sein oder es unterstützen. +
  • Hubs: sind immer transparent
  • +
  • Dumb Switches: normalerweise transparent, bessere prioritisieren damit den Datenverkehr
  • +
  • Smart Switches: hängt von den Einstellungen ab
  • +
  • PCs und dergleichen: neue Systeme unterstützten es defaultmässig, für ältere in den Einstellungen der Netzwerkarte nachschauen
  • +
  • WLAN Accesspoints: hängt von Modell und deren Firmware ab. OpenWRT basierte Geräte unterstützen es normalerweise
  • +
    + +
    +
     
    + + + + + diff --git a/octoserve/var/www/systeminfo.lua b/octoserve/var/www/systeminfo.lua new file mode 100644 index 0000000..82b8c0a --- /dev/null +++ b/octoserve/var/www/systeminfo.lua @@ -0,0 +1,60 @@ +#!/usr/bin/lua + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +function http_print(s) + io.stdout:write(s.."\r\n") +end + +http_print("HTTP/1.1 200") +http_print("Pragma: no-cache") +http_print("Content-Type: application/x-javascript") +--http_print("Content-Type: text/plain") +http_print("") + +local ddtest = io.popen("ddtest reg 0+4","r") +local ddo = ddtest:read("*a") +ddtest:close() + +local registers = {} +for v in string.gmatch(ddo,"%((%-?%d+)%)") do + table.insert(registers,v) +end + +local tmp = io.popen("uname -r -m","r") +local tmp1 = tmp:read() +tmp:close() + +-- local uname = string.match(tmp1,"Linux (%.+)") +-- http_print(tmp1) +-- http_print(uname) +local uname = tmp1 + +tmp = io.popen("ls /config/*.img","r") +local fwimg = tmp:read("*a") +tmp:close() + +local images = {} +for v in string.gmatch(fwimg,"%.(%d+)%.") do + table.insert(images,v) +end +local fwdate = ""; +if images[1] then fwdate = images[1] end + +beta = "false" +tmp = io.open("/config/updateserver") +if tmp then + beta = "true" + tmp:close() +end + +http_print(string.format("var linuxver = \"%s\";",uname)) +http_print(string.format("var fpgaver = \"%d.%d\";",(registers[1] / 65536) % 65536,registers[1] % 65536)) +http_print(string.format("var fpgatype = \"%0X\";",registers[3] / 65536)) +-- http_print(string.format("var fpgaver = \"%d.%d\";",registers[1] >> 16,registers[1] & 0xffff)) +-- http_print(string.format("var fpgatype = \"%0X\";",registers[3] >> 16)) +http_print(string.format("var fwdate = \"%s\";",fwdate)) +http_print(string.format("var host = \"%s\";",host)) +http_print(string.format("var beta = %s;",beta)) diff --git a/octoserve/var/www/systemsettings.lua b/octoserve/var/www/systemsettings.lua new file mode 100644 index 0000000..96b65f3 --- /dev/null +++ b/octoserve/var/www/systemsettings.lua @@ -0,0 +1,130 @@ +#!/usr/bin/lua + +function SaveOctoserveConf(Section,Values) + local ConfStart + local ConfEnd + local f = io.open("/config/octoserve.conf","r") + if f then + local CurConf = f:read("*a") + f:close() + ConfStart,ConfEnd = string.match(CurConf,"(.-)%["..Section.."%].+\n(%[.+)") + os.remove("/config/octoserve.bak") + os.rename("/config/octoserve.conf","/config/octoserve.bak") + end + + f = io.open("/config/octoserve.conf","w") + if ConfStart then + f:write(ConfStart) + end + f:write("["..Section.."]\n") + f:write(Values) + if ConfEnd then + f:write(ConfEnd) + end + f:close() +end + +function ReadSetting(name) + local enabled = false + local tmp = io.open("/config/"..name..".enabled","r") + if tmp then + enabled = true + end + return(enabled) +end + +function WriteSetting(name,enabled) + local wasenabled = false + if os.remove("/config/"..name..".enabled") then wasenabled = true end + if( enabled ) then + local f = io.open("/config/"..name..".enabled","w") + if f then + f:write("1") + f:close() + end + end + return enabled ~= wasenabled +end + + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") + +if arg[1] then + query = arg[1] + proto = "HTTP/1.0" + host = "local" +end + +if query ~= "" then + os.execute("echo \""..query.."\" >/tmp/query") + local params = {} + for w in string.gmatch(query,"(%a%w+%=%d+%,?%d*%,?%d*)") do + table.insert(params,w) + end + + -- TODO: More validation + local nextloc = "index.html" + local restart = 0; + for _,v in ipairs(params) do + name,value = string.match(v,"(%w+)%=(%d+)") + if( WriteSetting(name,value == "1") ) then + if name == "telnet" then + os.rename("/etc/securetty","/etc/securetty.bak"); -- temp fix to allow root login on telnet + os.execute("/etc/init.d/S91telnet restart") + end +-- if name == "vlan" then os.execute("/etc/init.d/S99octo restartoctonet&") end +-- if name == "nodms" then os.execute("/etc/init.d/S99octo restartoctonet&") end +-- if name == "nodvbt" then os.execute("/etc/init.d/S99octo restartoctonet&") end + if name == "vlan" then restart = 1 end + if name == "nodms" then restart = 1 end + if name == "nodvbt" then restart = 1 end + if name == "noswitch" then restart = 1 end + nextloc = "wait.html?5" + end + end + if restart == 1 then os.execute("/etc/init.d/S99octo restartoctonet&") end + print(proto.." 303") + print("Location: http://"..host.."/"..nextloc) + print("") +else + + print(proto.." 200") + print("Pragma: no-cache") + print("Content-Type: application/x-javascript") + print("") + + if ReadSetting("telnet") then + print("telnetEnabled = true;") + else + print("telnetEnabled = false;") + end + + if ReadSetting("vlan") then + print("vlanEnabled = true;") + else + print("vlanEnabled = false;") + end + + if ReadSetting("nodms") then + print("nodmsEnabled = true;") + else + print("nodmsEnabled = false;") + end + + if ReadSetting("nodvbt") then + print("nodvbtEnabled = true;") + else + print("nodvbtEnabled = false;") + end + + if ReadSetting("noswitch") then + print("noswitchEnabled = true;") + else + print("noswitchEnabled = false;") + end + +end + + diff --git a/octoserve/var/www/template.html b/octoserve/var/www/template.html new file mode 100644 index 0000000..5f4ffc1 --- /dev/null +++ b/octoserve/var/www/template.html @@ -0,0 +1,63 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + + + bla bla +

    + bla bla +

    + bla bla +

    + bla bla +

    + bla bla +

    + bla bla +

    + bla bla +

    + bla bla +

    + bla bla +

    + bla bla +

    + bla bla + + + +

    +
     
    + + + diff --git a/octoserve/var/www/tunerstatus.html b/octoserve/var/www/tunerstatus.html new file mode 100644 index 0000000..ff86576 --- /dev/null +++ b/octoserve/var/www/tunerstatus.html @@ -0,0 +1,118 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + + + + + + + + + + + +
    + Tuner + + Lock + + Strength + + Quality +
    + + + +
    +
     
    + + + diff --git a/octoserve/var/www/update.html b/octoserve/var/www/update.html new file mode 100644 index 0000000..99369ce --- /dev/null +++ b/octoserve/var/www/update.html @@ -0,0 +1,136 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + + + + + + + + + + + +
    Check for firmware/system update: +
    + +
    +
      
    + + + +
    +
     
    + + + diff --git a/octoserve/var/www/update.lua b/octoserve/var/www/update.lua new file mode 100644 index 0000000..bd410e1 --- /dev/null +++ b/octoserve/var/www/update.lua @@ -0,0 +1,143 @@ +#!/usr/bin/lua + +local query = "" +local DoUpdate = false +local DoCheck = false + +if arg[1] then + if arg[1] == "doupdate" then + DoUpdate = true + DoCheck = true + else + query = arg[1] + end +else + query = os.getenv("QUERY_STRING") +end + +if query == "check" then + DoCheck = true +end + +local userver = "download.digital-devices.de/download/linux" +local NewImage = "octonet.0000000000.img" +local CurImage = "octonet.0000000000.img" + +if DoCheck then + + local tmp = io.open("/config/updateserver") + if tmp then + userver = tmp:read() + tmp:close() + end + + local tmp = io.popen(string.format("wget http://%s/octonet/ -q -O -",userver),"r") + local serverdir = tmp:read("*a") + tmp:close() + + local tmp = io.popen("ls /config/octonet.*.img","r") + local configdir = tmp:read("*a") + tmp:close() + + for v in string.gmatch(serverdir,"\"(octonet%.%d+%.img)\"") do + if v > NewImage then + NewImage = v + end + end + + for v in string.gmatch(configdir,"(octonet%.%d+%.img)") do + if v > CurImage then + CurImage = v + end + end +end + +if DoUpdate then + if NewImage > CurImage then + os.execute("echo CheckDone >/tmp/updatestatus") + os.remove("/config/tmpimage") + local wgetstatus = os.execute(string.format("wget -q -P /config http://%s/octonet/%s -O /config/tmpimage >/dev/null 2>/dev/null",userver,NewImage)) + if wgetstatus == 0 then + local ShaFile = string.gsub(NewImage,".img",".sha") + wgetstatus = os.execute(string.format("wget -q -P /config http://%s/octonet/%s -O /config/%s >/dev/null 2>/dev/null",userver,ShaFile,ShaFile)) + os.execute("echo DownloadDone >/tmp/updatestatus") + if wgetstatus == 0 then + local tmp = io.popen(string.format("sha256sum /config/tmpimage","r")) + local csum1 = tmp:read() + tmp:close() + local csum2 = io.open(string.format("/config/%s",ShaFile)):read() + csum1 = string.match(csum1,"(%x+)") + csum2 = string.match(csum2,"(%x+)") + if csum1 == csum2 then + os.execute("lua /etc/switch/swsetup.lua gb yb"); + os.rename("/config/tmpimage",string.format("/config/%s",NewImage)) + os.remove(string.format("/config/%s",CurImage)) + os.remove(string.format("/config/%s",string.gsub(CurImage,".img",".sha"))) + os.remove("/boot/uImage") + os.execute("echo VerifyDone >/tmp/updatestatus") + else + print("Error") + os.remove("/config/tmpimage") + os.remove(string.format("/config/%s",ShaFile)) + os.execute("echo VerifyError >/tmp/updatestatus") + return + end + else + os.remove("/config/tmpimage") + os.remove(string.format("/config/%s",ShaFile)) + os.execute("echo DownloadError >/tmp/updatestatus") + end + else + os.remove("/config/tmpimage") + os.execute("echo DownloadError >/tmp/updatestatus") + end + else + os.execute("echo CheckError >/tmp/updatestatus") + end + return +end + +print("HTTP/1.0 200 ") +print("Pragma: no-cache") +print("Content-Type: application/x-javascript") +print("") + +if query == "check" then + + if NewImage > CurImage then + print(string.format("UpdateInfo = \"%s\";",string.match(NewImage,"octonet%.(%d+)"))) + else + print("UpdateInfo = \"\";") + end + print("CheckDone = true;") +elseif query == "update" then + os.remove("/tmp/updatestatus") + print("UpdateStarted = true;") + os.execute("lua update.lua doupdate >/dev/null 2>/dev/null &") +elseif query == "updatestatus" then + local tmp = io.open("/tmp/updatestatus") + local updatestatus = "" + if tmp then + updatestatus = tmp:read() + tmp:close() + end + if updatestatus == "CheckDone" then + print("CheckDone = true;") + elseif updatestatus == "DownloadDone" then + print("DownloadDone = true;") + elseif updatestatus == "VerifyDone" then + print("VerifyDone = true;") + elseif string.match(updatestatus,"(Error)") then + print(string.format("UpdateInfo = \'%s\';",updatestatus)) + print("UpdateError = true;") + end +else + print(string.format("UpdateInfo = \'%s\';",query)) + print("UpdateError = true;") +end + + + + + + diff --git a/octoserve/var/www/uplchannels.lua b/octoserve/var/www/uplchannels.lua new file mode 100644 index 0000000..ea40a29 --- /dev/null +++ b/octoserve/var/www/uplchannels.lua @@ -0,0 +1,82 @@ +#!/usr/bin/lua + +local host = os.getenv("HTTP_HOST") +local proto = os.getenv("SERVER_PROTOCOL") +local query = os.getenv("QUERY_STRING") +local method = os.getenv("REQUEST_METHOD") +local clength = os.getenv("CONTENT_LENGTH") +local ctype = os.getenv("CONTENT_TYPE") + +if arg[1] then + query = arg[1] + if query == "get" then query = "" end + proto = "HTTP/1.0" + host = "local" +end + +function SendError(err,desc) + io.stdout:write(proto.." "..err.."\r\n") + io.stdout:write("Content-Type: text/html".."\r\n") + io.stdout:write("\r\n") + local file = io.open("e404.html") + if file then + local tmp = file:read("*a") + tmp = string.gsub(tmp,"404 Not Found",err .. " " .. desc) + io.stdout:write(tmp) + file:close() + end +end + +local path = nil +local tmp = "/var/tmp/xxxx" + +if method ~= "POST" or not clength or not ctype then + SendError("404","?") + return +end + +if not string.match(ctype,"multipart/form%-data") then + SendError("404","??") + return +end + +local boundary = string.match(ctype,"boundary=(.*)") +if not boundary then + SendError("404","???") + return +end + +local filename = nil + +while true do + local line = io.stdin:read() + line = string.gsub(line,"\r","") + if line == "" then break end + if not filename then + filename = string.match(line,'filename=%"(.*)%"') + end +end + +data = io.stdin:read("*a") +data = string.sub(data,1,#data - #boundary - 4) + +local file = io.open("/tmp/"..filename,"w") +if file then + file:write(data) + file:close() +end + +if string.match(filename,"%.tar%.gz$") then + os.execute("rm -rf /config/channels;mkdir /config/channels;cd /config/channels;gunzip -c /tmp/"..filename.."|tar -xf -"); +elseif string.match(filename,"%.zip$") then + os.execute("rm -rf /config/channels;mkdir /config/channels;cd /config/channels;unzip -q /tmp/"..filename); +end + +os.remove("/tmp/"..filename) + +-- TODO validate + +io.stdout:write(proto.." 303".."\r\n") +io.stdout:write("Location: http://"..host.."/reboot.html") +io.stdout:write("\r\n") + diff --git a/octoserve/var/www/wait.html b/octoserve/var/www/wait.html new file mode 100644 index 0000000..a48ac31 --- /dev/null +++ b/octoserve/var/www/wait.html @@ -0,0 +1,61 @@ + + + + +OctopusNet + + + + + + + + + + + + + + + + + + + + + +
    + DD +
     
    +
    + +

     

    + +
    +
     
    + + + diff --git a/octoserve/version.h b/octoserve/version.h new file mode 100644 index 0000000..7c351f0 --- /dev/null +++ b/octoserve/version.h @@ -0,0 +1,23 @@ +/* + (C) 2012-13 Digital Devices GmbH. + + This file is part of the octoserve SAT>IP server. + + Octoserve is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Octoserve is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with octoserve. If not, see . +*/ + +#ifndef _OCTOSERVE_VERSION_ +#define _OCTOSERVE_VERSION_ +#define OCTOSERVE_VERSION "1.0.46" +#endif diff --git a/u-boot.patch b/u-boot.patch new file mode 100644 index 0000000..96e07a9 --- /dev/null +++ b/u-boot.patch @@ -0,0 +1,1073 @@ +diff --git a/board/DigitalDevices/naxy400/Makefile b/board/DigitalDevices/naxy400/Makefile +new file mode 100644 +index 0000000..d4ba028 +--- /dev/null ++++ b/board/DigitalDevices/naxy400/Makefile +@@ -0,0 +1,2 @@ ++obj-y += naxy400.o ++ +diff --git a/board/DigitalDevices/naxy400/naxy400.c b/board/DigitalDevices/naxy400/naxy400.c +new file mode 100644 +index 0000000..73d1b20 +--- /dev/null ++++ b/board/DigitalDevices/naxy400/naxy400.c +@@ -0,0 +1,269 @@ ++/* ++ * (C) Copyright 2007-2008 ++ * Stelian Pop ++ * Lead Tech Design ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * 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 the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++ * MA 02111-1307 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) ++#include ++#endif ++#include ++#include ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++void octonet_fpga_init(void) ++{ ++ struct at91_smc *smc = (struct at91_smc *) ATMEL_BASE_SMC; ++ struct at91_pmc *pmc = (struct at91_smc *) ATMEL_BASE_PMC; ++ struct at91_port *pioc = (struct at91_port *) ATMEL_BASE_PIOC; ++ u32 hw, reg; ++ ++ writel(0x00000000, &smc->cs[0].setup); ++ writel(0x09090909, &smc->cs[0].pulse); ++ writel(0x000b000b, &smc->cs[0].cycle); ++ writel(0x10001000, &smc->cs[0].mode); ++ ++ writel(0x00000000, &smc->cs[2].setup); ++ writel(0x09090909, &smc->cs[2].pulse); ++ writel(0x000b000b, &smc->cs[2].cycle); ++ writel(0x10001000, &smc->cs[2].mode); ++ ++ //writel(0x00002000, &pioc->pdr); ++ writel(0x00002000, 0xfffff604); ++ ++ hw = readl(ATMEL_BASE_CS2); ++ reg = readl(ATMEL_BASE_CS2 + 4); ++ printf("FPGA: HW=%08x, REG=%08x\n", hw, reg); ++ ++ /* Disable MDIO, IRQ, ether output */ ++ writel(0, ATMEL_BASE_CS2 + 0x20); ++ writel(0, ATMEL_BASE_CS2 + 0x20); ++ writel(0, ATMEL_BASE_CS2 + 0x100); ++ ++ at91_set_a_periph(AT91_PIO_PORTD, 26, 0); ++ writel(0x00000100, &pmc->pck[0]); ++ writel(AT91_PMC_PCK0, &pmc->scer); ++ ++ at91_set_gpio_output(AT91_PIN_PD11, 1); ++ at91_set_gpio_output(AT91_PIN_PD10, 1); ++ at91_set_gpio_output(AT91_PIN_PD12, 1); ++} ++ ++#ifdef CONFIG_CMD_NAND ++void at91sam9m10g45ek_nand_hw_init(void) ++{ ++ struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC; ++ struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX; ++ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; ++ unsigned long csa; ++ ++ /* Enable CS3 */ ++ csa = readl(&matrix->ebicsa); ++ csa |= AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA; ++ writel(csa, &matrix->ebicsa); ++ ++ /* Configure SMC CS3 for NAND/SmartMedia */ ++ writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) | ++ AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0), ++ &smc->cs[3].setup); ++ writel(AT91_SMC_PULSE_NWE(4) | AT91_SMC_PULSE_NCS_WR(3) | ++ AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(2), ++ &smc->cs[3].pulse); ++ writel(AT91_SMC_CYCLE_NWE(7) | AT91_SMC_CYCLE_NRD(4), ++ &smc->cs[3].cycle); ++ writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | ++ AT91_SMC_MODE_EXNW_DISABLE | ++#ifdef CONFIG_SYS_NAND_DBW_16 ++ AT91_SMC_MODE_DBW_16 | ++#else /* CONFIG_SYS_NAND_DBW_8 */ ++ AT91_SMC_MODE_DBW_8 | ++#endif ++ AT91_SMC_MODE_TDF_CYCLE(3), ++ &smc->cs[3].mode); ++ ++ writel(1 << ATMEL_ID_PIOC, &pmc->pcer); ++ ++ /* Configure RDY/BSY */ ++ at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1); ++ ++ /* Enable NandFlash */ ++ at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1); ++} ++#endif ++ ++#ifdef CONFIG_CMD_USB ++static void at91sam9m10g45ek_usb_hw_init(void) ++{ ++ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; ++ ++ writel(1 << ATMEL_ID_PIODE, &pmc->pcer); ++ ++ at91_set_gpio_output(AT91_PIN_PD1, 0); ++ at91_set_gpio_output(AT91_PIN_PD3, 0); ++} ++#endif ++ ++#ifdef CONFIG_MACB ++static void at91sam9m10g45ek_macb_hw_init(void) ++{ ++ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; ++ struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA; ++ struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC; ++ unsigned long erstl; ++ ++ /* Enable clock */ ++ writel(1 << ATMEL_ID_EMAC, &pmc->pcer); ++ ++ /* ++ * Disable pull-up on: ++ * RXDV (PA15) => PHY normal mode (not Test mode) ++ * ERX0 (PA12) => PHY ADDR0 ++ * ERX1 (PA13) => PHY ADDR1 => PHYADDR = 0x0 ++ * ++ * PHY has internal pull-down ++ */ ++ writel(pin_to_mask(AT91_PIN_PA15) | ++ pin_to_mask(AT91_PIN_PA12) | ++ pin_to_mask(AT91_PIN_PA13), ++ &pioa->pudr); ++ ++#if 0 ++ erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK; ++ ++ /* Need to reset PHY -> 500ms reset */ ++ writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) | ++ AT91_RSTC_MR_URSTEN, &rstc->mr); ++ ++ writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr); ++ ++ /* Wait for end hardware reset */ ++ while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL)) ++ ; ++ ++ /* Restore NRST value */ ++ writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, ++ &rstc->mr); ++#endif ++ /* Re-enable pull-up */ ++ writel(pin_to_mask(AT91_PIN_PA15) | ++ pin_to_mask(AT91_PIN_PA12) | ++ pin_to_mask(AT91_PIN_PA13), ++ &pioa->puer); ++ ++ /* And the pins. */ ++ at91_macb_hw_init(); ++} ++#endif ++ ++int board_early_init_f(void) ++{ ++ at91_seriald_hw_init(); ++ return 0; ++} ++ ++void setmac() ++{ ++ unsigned char mac[6]; ++ char buf[12]; ++ u32 macreg = readl(ATMEL_BASE_CS2 + 12); ++ ++ if (eth_getenv_enetaddr("ethaddr", mac)) ++ return; ++ ++ //printf("macreg = %08x\n", macreg); ++ if ((macreg & 0xff) == 1) { ++ mac[0] = 0x54; ++ mac[1] = 0x84; ++ mac[2] = 0x7b; ++ mac[3] = (macreg >> 8) & 0xff; ++ mac[4] = (macreg >> 16) & 0xff; ++ mac[5] = (macreg >> 24) & 0xff; ++ //sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x", ++ // mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); ++ //setenv("ethaddr", buf); ++ eth_setenv_enetaddr("ethaddr", mac); ++ //printf("MAC = %s\n", buf); ++ } ++} ++ ++int misc_init_r(void) ++{ ++ setmac(); ++ return 0; ++} ++ ++int board_init(void) ++{ ++ console_init_f(); ++ gd->bd->bi_arch_number = MACH_TYPE_NAXY400; ++ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; ++ ++#ifdef CONFIG_CMD_NAND ++ at91sam9m10g45ek_nand_hw_init(); ++#endif ++#ifdef CONFIG_CMD_USB ++ at91sam9m10g45ek_usb_hw_init(); ++#endif ++#ifdef CONFIG_MACB ++ at91sam9m10g45ek_macb_hw_init(); ++#endif ++ octonet_fpga_init(); ++ spi_init(); ++ ++ // icache_enable(); ++ // dcache_enable(); ++ return 0; ++} ++ ++int dram_init(void) ++{ ++ gd->ram_size = get_ram_size((void *) CONFIG_SYS_SDRAM_BASE, ++ CONFIG_SYS_SDRAM_SIZE); ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++void reset_phy(void) ++{ ++} ++#endif ++ ++int board_eth_init(bd_t *bis) ++{ ++ int rc = 0; ++ ++#ifdef CONFIG_MACB ++ rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00); ++#endif ++ return rc; ++} ++ +diff --git a/boards.cfg b/boards.cfg +index 1ba2081..e58f542 100644 +--- a/boards.cfg ++++ b/boards.cfg +@@ -141,6 +141,8 @@ Active arm arm926ejs at91 ronetix pm9261 + Active arm arm926ejs at91 ronetix pm9263 pm9263 pm9263:AT91SAM9263 Ilko Iliev + Active arm arm926ejs at91 ronetix pm9g45 pm9g45 pm9g45:AT91SAM9G45 Ilko Iliev + Active arm arm926ejs at91 siemens corvus corvus corvus:AT91SAM9M10G45,SYS_USE_NANDFLASH Heiko Schocher ++Active arm arm926ejs at91 DigitalDevices naxy400 naxy400 naxy400:AT91SAM9M10G45,SYS_USE_NANDFLASH Ralph Metzler ++#naxy400 arm arm926ejs naxy400 DigitalDevices at91 naxy400:AT91SAM9G45,SYS_USE_NANDFLASH + Active arm arm926ejs at91 siemens taurus axm taurus:AT91SAM9G20,MACH_TYPE=2068,BOARD_AXM Heiko Schocher + Active arm arm926ejs at91 siemens taurus taurus taurus:AT91SAM9G20,MACH_TYPE=2067,BOARD_TAURUS Heiko Schocher + Active arm arm926ejs at91 taskit stamp9g20 portuxg20 stamp9g20:AT91SAM9G20,PORTUXG20 Markus Hubig +diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c +index 6517af1..9ae7855 100644 +--- a/drivers/gpio/at91_gpio.c ++++ b/drivers/gpio/at91_gpio.c +@@ -395,3 +395,9 @@ int gpio_set_value(unsigned gpio, int value) + + return 0; + } ++ ++void gpio_toggle_value(unsigned gpio) ++{ ++ gpio_set_value(gpio, !gpio_get_value(gpio)); ++} ++ +diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c +index e73834d..c24021e 100644 +--- a/drivers/mtd/nand/atmel_nand.c ++++ b/drivers/mtd/nand/atmel_nand.c +@@ -1393,6 +1393,8 @@ int atmel_nand_chip_init(int devnum, ulong base_addr) + + #ifdef CONFIG_NAND_ECC_BCH + nand->ecc.mode = NAND_ECC_SOFT_BCH; ++ nand->ecc.size = 512; ++ nand->ecc.bytes = 13; + #else + nand->ecc.mode = NAND_ECC_SOFT; + #endif +diff --git a/drivers/net/macb.c b/drivers/net/macb.c +index 01a94a4..cafbbd2 100644 +--- a/drivers/net/macb.c ++++ b/drivers/net/macb.c +@@ -132,6 +132,33 @@ static void macb_mdio_write(struct macb_device *macb, u8 reg, u16 value) + macb_writel(macb, NCR, netctl); + } + ++static void macb_mdio_swrite(struct macb_device *macb, u8 adr, u8 reg, u16 value) ++{ ++ unsigned long netctl; ++ unsigned long netstat; ++ unsigned long frame; ++ ++ netctl = macb_readl(macb, NCR); ++ netctl |= MACB_BIT(MPE); ++ macb_writel(macb, NCR, netctl); ++ ++ frame = (MACB_BF(SOF, 1) ++ | MACB_BF(RW, 1) ++ | MACB_BF(PHYA, adr) ++ | MACB_BF(REGA, reg) ++ | MACB_BF(CODE, 2) ++ | MACB_BF(DATA, value)); ++ macb_writel(macb, MAN, frame); ++ ++ do { ++ netstat = macb_readl(macb, NSR); ++ } while (!(netstat & MACB_BIT(IDLE))); ++ ++ netctl = macb_readl(macb, NCR); ++ netctl &= ~MACB_BIT(MPE); ++ macb_writel(macb, NCR, netctl); ++} ++ + static u16 macb_mdio_read(struct macb_device *macb, u8 reg) + { + unsigned long netctl; +@@ -169,16 +196,51 @@ void __weak arch_get_mdio_control(const char *name) + + #if defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB) + ++static u16 macb_mdio_sread(struct macb_device *macb, u8 adr, u8 reg) ++{ ++ unsigned long netctl; ++ unsigned long netstat; ++ unsigned long frame; ++ ++ netctl = macb_readl(macb, NCR); ++ netctl |= MACB_BIT(MPE); ++ macb_writel(macb, NCR, netctl); ++ ++ frame = (MACB_BF(SOF, 1) ++ | MACB_BF(RW, 2) ++ | MACB_BF(PHYA, adr) ++ | MACB_BF(REGA, reg) ++ | MACB_BF(CODE, 2)); ++ macb_writel(macb, MAN, frame); ++ ++ do { ++ netstat = macb_readl(macb, NSR); ++ } while (!(netstat & MACB_BIT(IDLE))); ++ ++ frame = macb_readl(macb, MAN); ++ ++ netctl = macb_readl(macb, NCR); ++ netctl &= ~MACB_BIT(MPE); ++ macb_writel(macb, NCR, netctl); ++ ++ return MACB_BFEXT(DATA, frame); ++} ++ ++ + int macb_miiphy_read(const char *devname, u8 phy_adr, u8 reg, u16 *value) + { + struct eth_device *dev = eth_get_dev_by_name(devname); + struct macb_device *macb = to_macb(dev); + +- if (macb->phy_addr != phy_adr) +- return -1; ++ //if ( macb->phy_addr != phy_adr ) ++ // return -1; + ++#if 0 + arch_get_mdio_control(devname); + *value = macb_mdio_read(macb, reg); ++#else ++ *value = macb_mdio_sread(macb, phy_adr, reg); ++#endif + + return 0; + } +@@ -188,11 +250,15 @@ int macb_miiphy_write(const char *devname, u8 phy_adr, u8 reg, u16 value) + struct eth_device *dev = eth_get_dev_by_name(devname); + struct macb_device *macb = to_macb(dev); + +- if (macb->phy_addr != phy_adr) +- return -1; ++ //if ( macb->phy_addr != phy_adr ) ++ //return -1; + ++#if 0 + arch_get_mdio_control(devname); + macb_mdio_write(macb, reg, value); ++#else ++ macb_mdio_swrite(macb, phy_adr, reg, value); ++#endif + + return 0; + } +@@ -353,7 +419,6 @@ static int macb_recv(struct eth_device *netdev) + macb->rx_buffer, taillen); + buffer = (void *)NetRxPackets[0]; + } +- + NetReceive(buffer, length); + if (++rx_tail >= MACB_RX_RING_SIZE) + rx_tail = 0; +@@ -534,6 +599,56 @@ static int macb_phy_init(struct macb_device *macb) + return 1; + } + ++static void swrite(struct macb_device *macb, u8 phy, u8 reg, u16 value) ++{ ++ u16 val; ++ ++ while (0x8000 & macb_mdio_sread(macb, 0x1c, 0x18)); ++ macb_mdio_swrite(macb, 0x1c, 0x19, value); ++ macb_mdio_swrite(macb, 0x1c, 0x18, 0x9400|(phy<<5)|reg); ++} ++ ++static int mdio_switch_init(struct macb_device *macb) ++{ ++ int phy; ++ ++ macb_mdio_swrite(macb, 0x16, 0x01, 0xc003); ++ macb_mdio_swrite(macb, 0x16, 0x08, 0x8080); ++ for (phy=0; phy<=4; phy++) { ++ swrite(macb, phy, 0x00, 0x1140); ++ swrite(macb, phy, 0x16, 0x0000); ++ swrite(macb, phy, 0x10, 0x3360); ++ } ++ for (phy=0; phy<=6; phy++) ++ macb_mdio_swrite(macb, 0x10|phy, 0x04, 0x007f); ++} ++ ++static int macb_switch_init(struct macb_device *macb) ++{ ++ struct eth_device *netdev = &macb->netdev; ++ u32 ncfgr; ++ u16 status, adv, lpa; ++ int speed, duplex; ++ ++ speed = 1; ++ duplex = 1; ++ printf("%s: link up, %sMbps %s-duplex\n", ++ netdev->name, ++ speed ? "100" : "10", ++ duplex ? "full" : "half"); ++ ++ ncfgr = macb_readl(macb, NCFGR); ++ ncfgr &= ~(MACB_BIT(SPD) | MACB_BIT(FD)); ++ if (speed) ++ ncfgr |= MACB_BIT(SPD); ++ if (duplex) ++ ncfgr |= MACB_BIT(FD); ++ macb_writel(macb, NCFGR, ncfgr); ++ ++ //mdio_switch_init(macb); ++ return 1; ++} ++ + static int macb_init(struct eth_device *netdev, bd_t *bd) + { + struct macb_device *macb = to_macb(netdev); +@@ -596,9 +711,17 @@ static int macb_init(struct eth_device *netdev, bd_t *bd) + #endif /* CONFIG_RMII */ + } + ++ ++#ifdef CONFIG_OCTONET ++#if 1 ++ macb_writel(macb, USRIO, MACB_BIT(CLKEN)); ++ if (!macb_switch_init(macb)) ++ return -1; ++#endif ++#else + if (!macb_phy_init(macb)) + return -1; +- ++#endif + /* Enable TX and RX */ + macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE)); + +@@ -694,6 +817,21 @@ static u32 macb_dbw(struct macb_device *macb) + } + } + ++void octo_mac_read(u8 *mac) ++{ ++ u32 macreg = readl(0x3000000c); ++ ++ //printf("macreg = %08x\n", macreg); ++ if ((macreg & 0xff) == 1) { ++ mac[0] = 0x54; ++ mac[1] = 0x84; ++ mac[2] = 0x7b; ++ mac[3] = (macreg >> 8) & 0xff; ++ mac[4] = (macreg >> 16) & 0xff; ++ mac[5] = (macreg >> 24) & 0xff; ++ } ++} ++ + int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) + { + struct macb_device *macb; +@@ -726,6 +864,9 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) + else + sprintf(netdev->name, "macb%d", id); + ++#ifdef CONFIG_OCTONET ++ //octo_mac_read(netdev->enetaddr); ++#endif + netdev->init = macb_init; + netdev->halt = macb_halt; + netdev->send = macb_send; +@@ -751,6 +892,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) + miiphy_register(netdev->name, macb_miiphy_read, macb_miiphy_write); + macb->bus = miiphy_get_dev_by_name(netdev->name); + #endif ++ mdio_switch_init(macb); + return 0; + } + +diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile +index f02c35a..4e2531a 100644 +--- a/drivers/spi/Makefile ++++ b/drivers/spi/Makefile +@@ -42,3 +42,4 @@ obj-$(CONFIG_TI_QSPI) += ti_qspi.o + obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o + obj-$(CONFIG_ZYNQ_SPI) += zynq_spi.o + obj-$(CONFIG_FSL_QSPI) += fsl_qspi.o ++obj-$(CONFIG_OCTONET_SPI) += octonet_spi.o +diff --git a/drivers/spi/octonet_spi.c b/drivers/spi/octonet_spi.c +new file mode 100644 +index 0000000..5fca502 +--- /dev/null ++++ b/drivers/spi/octonet_spi.c +@@ -0,0 +1,258 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++struct octonet_spi_slave { ++ struct spi_slave slave; ++ u32 base; ++}; ++#define to_octonet_spi_slave(s) container_of(s, struct octonet_spi_slave, slave) ++ ++void spi_init (void) ++{ ++ //printf("OCTONET spi init\n"); ++} ++ ++struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, ++ unsigned int max_hz, unsigned int mode) ++{ ++ struct octonet_spi_slave *os; ++ ++ if (bus || cs) ++ return NULL; ++ ++ printf("OCTONET spi setup\n"); ++ os = malloc(sizeof(struct octonet_spi_slave)); ++ if (!os) ++ return NULL; ++ ++ os->slave.bus = bus; ++ os->slave.cs = cs; ++ os->base = 0; ++ ++ return &os->slave; ++} ++ ++void spi_free_slave(struct spi_slave *slave) ++{ ++ struct octonet_spi_slave *os = to_octonet_spi_slave(slave); ++ ++ free(os); ++} ++ ++int spi_claim_bus(struct spi_slave *slave) ++{ ++ return 0; ++} ++ ++void spi_release_bus(struct spi_slave *slave) ++{ ++} ++ ++#define SPI_CONTROL 0x30000010 ++#define SPI_DATA 0x30000014 ++ ++int spi_xfer2(struct spi_slave *slave, unsigned int bitlen, ++ const void *out, void *in, unsigned long flags) ++{ ++ u32 data, shift; ++ u32 wlen, rlen; ++ u8 *wbuf = out; ++ u8 *rbuf = in; ++ ++ printf("OCTONET spi xfer %08x %08x %d\n", (u32) wbuf, (u32) rbuf, bitlen); ++ ++ if (bitlen % 8) ++ return -1; ++ rlen = wlen = 0; ++ if (out) ++ wlen = bitlen / 8; ++ if (in) ++ rlen = bitlen / 8; ++ //printf("wlen = %d, rlen = %d, %02x\n", wlen, rlen, flags); ++ ++ if (!wlen && !rlen && (flags & SPI_XFER_END)) { ++ writel(0x0003 | ((1 << (8 + 3)) & 0x1f00), SPI_CONTROL); ++ writel(0xffffffff, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ return 0; ++ } ++ ++ ++ if (wlen==1) ++ printf("%02x\n", wbuf[0]); ++ ++ ++ if (wlen > 4) ++ writel(1, SPI_CONTROL); ++ while (wlen > 4) { ++ data = (wbuf[0]<<24) | (wbuf[1]<<16) | (wbuf[2]<<8) | wbuf[3]; ++ wbuf += 4; ++ wlen -= 4; ++ writel(data, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ } ++ ++ if (wlen) { ++ if (rlen || !(flags & SPI_XFER_END)) ++ writel(0x0001 | ((wlen << (8 + 3)) & 0x1f00), SPI_CONTROL); ++ else ++ writel(0x0003 | ((wlen << (8 + 3)) & 0x1f00), SPI_CONTROL); ++ ++ data = 0; ++ shift = ((4 - wlen) * 8); ++ while (wlen) { ++ data <<= 8; ++ data |= *wbuf; ++ wlen--; ++ wbuf++; ++ } ++ if (shift) ++ data <<= shift; ++ writel(data, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ } ++ ++ if (!rlen) ++ return 0; ++ if (rlen > 4) ++ writel(1, SPI_CONTROL); ++ ++ while (rlen > 4) { ++ writel(0xffffffff, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ data = readl(SPI_DATA); ++ rbuf[0] = (data>>24)&0xff; ++ rbuf[1] = (data>>16)&0xff; ++ rbuf[2] = (data>>8)&0xff; ++ rbuf[3] = data&0xff; ++ rbuf += 4; ++ rlen -= 4; ++ } ++ ++ if (flags & SPI_XFER_END) ++ writel(0x0003 | ((rlen << (8 + 3)) & 0x1F00), SPI_CONTROL); ++ else ++ writel(0x0001 | ((rlen << (8 + 3)) & 0x1F00), SPI_CONTROL); ++ ++ writel(0xffffffff, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ data = readl(SPI_DATA); ++ ++ if (rlen < 4) ++ data <<= ((4 - rlen) * 8); ++ ++ while (rlen > 0) { ++ *rbuf = ((data >> 24) & 0xff); ++ data <<= 8; ++ rbuf++; ++ rlen--; ++ } ++ rbuf = in; ++ printf("%02x %02x %02x %02x %02x\n", rbuf[0], rbuf[1], rbuf[2], rbuf[3], rbuf[4]); ++ return(0); ++} ++ ++int spi_xfer(struct spi_slave *slave, unsigned int bitlen, ++ const void *out, void *in, unsigned long flags) ++{ ++ u32 data, shift; ++ u32 wlen, len; ++ u8 *wbuf = out; ++ u8 *rbuf = in; ++ ++ //printf("OCTONET spi xfer %08x %08x %d %d\n", (u32) wbuf, (u32) rbuf, bitlen/8, flags); ++ ++ if (!bitlen) { ++ if (flags & SPI_XFER_END) { ++ writel(0x0003 | ((1 << (8 + 3)) & 0x1f00), SPI_CONTROL); ++ writel(0xffffffff, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ } ++ writel(0, SPI_CONTROL); ++ return 0; ++ } ++ if (bitlen % 8) ++ return -1; ++ len = bitlen / 8; ++ ++#if 0 ++ if (wbuf && len==1) ++ printf("%02x\n", wbuf[0]); ++#endif ++ ++ if (len > 4) { ++ writel(1, SPI_CONTROL); ++ while (len > 4) { ++ if (wbuf) { ++ data = (wbuf[0]<<24) | (wbuf[1]<<16) | (wbuf[2]<<8) | wbuf[3]; ++ wbuf += 4; ++ } else ++ data = 0xffffffff; ++ writel(data, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ data = readl(SPI_DATA); ++ if (rbuf) { ++ data = readl(SPI_DATA); ++ rbuf[0] = (data>>24)&0xff; ++ rbuf[1] = (data>>16)&0xff; ++ rbuf[2] = (data>>8)&0xff; ++ rbuf[3] = data&0xff; ++ rbuf += 4; ++ } ++ len -= 4; ++ } ++ } ++ if (flags & SPI_XFER_END) ++ writel(0x0003 | ((len << (8 + 3)) & 0x1f00), SPI_CONTROL); ++ else ++ writel(0x0001 | ((len << (8 + 3)) & 0x1f00), SPI_CONTROL); ++ ++ wlen = len; ++ if (wbuf) { ++ data = 0; ++ shift = ((4 - wlen) * 8); ++ while (wlen) { ++ data <<= 8; ++ data |= *wbuf; ++ wlen--; ++ wbuf++; ++ } ++ if (shift) ++ data <<= shift; ++ } else ++ data = 0xffffffff; ++ writel(data, SPI_DATA); ++ while (readl(SPI_CONTROL) & 0x0004) ++ ; ++ data = readl(SPI_DATA); ++ ++ if (rbuf) { ++ data <<= ((4 - len) * 8); ++ while (len > 0) { ++ *rbuf = ((data >> 24) & 0xff); ++ data <<= 8; ++ rbuf++; ++ len--; ++ } ++ } ++ writel(0, SPI_CONTROL); ++ ++#if 0 ++ if (in) { ++ rbuf = in; ++ printf("%02x %02x %02x %02x %02x\n", rbuf[0], rbuf[1], rbuf[2], rbuf[3], rbuf[4]); ++ } ++#endif ++ return(0); ++} +diff --git a/include/configs/naxy400.h b/include/configs/naxy400.h +new file mode 100644 +index 0000000..91cd9e9 +--- /dev/null ++++ b/include/configs/naxy400.h +@@ -0,0 +1,237 @@ ++/* ++ * (C) Copyright 2007-2008 ++ * Stelian Pop ++ * Lead Tech Design ++ * ++ * Configuation settings for the AT91SAM9M10G45EK board(and AT91SAM9G45EKES). ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * 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 the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++ * MA 02111-1307 USA ++ */ ++ ++#ifndef __CONFIG_H ++#define __CONFIG_H ++ ++#include ++ ++#define CONFIG_SYS_TEXT_BASE 0x73000000 ++#define CONFIG_SYS_GENERIC_BOARD 1 ++ ++#define CONFIG_AT91_LEGACY ++#define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */ ++ ++/* ARM asynchronous clock */ ++#define CONFIG_SYS_AT91_SLOW_CLOCK 32768 ++#define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */ ++#define CONFIG_SYS_HZ 1000 ++ ++#define CONFIG_AT91SAM9M10G45EK ++#define CONFIG_AT91FAMILY ++#define CONFIG_ARCH_CPU_INIT ++#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ ++ ++#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ ++#define CONFIG_SETUP_MEMORY_TAGS ++#define CONFIG_INITRD_TAG ++#define CONFIG_SKIP_LOWLEVEL_INIT ++#define CONFIG_BOARD_EARLY_INIT_F ++#define CONFIG_DISPLAY_CPUINFO ++ ++/* general purpose I/O */ ++#define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */ ++#define CONFIG_AT91_GPIO ++#define CONFIG_AT91_GPIO_PULLUP 1 /* keep pullups on peripheral pins */ ++ ++/* serial console */ ++#define CONFIG_ATMEL_USART ++#define CONFIG_USART_BASE ATMEL_BASE_DBGU ++#define CONFIG_USART_ID ATMEL_ID_SYS ++ ++#define CONFIG_BOOTDELAY 1 ++ ++/* ++ * BOOTP options ++ */ ++#define CONFIG_BOOTP_BOOTFILESIZE ++#define CONFIG_BOOTP_BOOTPATH ++#define CONFIG_BOOTP_GATEWAY ++#define CONFIG_BOOTP_HOSTNAME ++ ++/* ++ * Command line configuration. ++ */ ++#include ++#undef CONFIG_CMD_BDI ++#undef CONFIG_CMD_FPGA ++#undef CONFIG_CMD_IMI ++#undef CONFIG_CMD_IMLS ++#undef CONFIG_CMD_LOADS ++#undef CONFIG_CMD_SOURCE ++#undef CONFIG_CMD_XIMG ++ ++#define CONFIG_CMD_PING ++#define CONFIG_CMD_DHCP ++#define CONFIG_CMD_NAND ++#define CONFIG_CMD_USB ++#define CONFIG_CMD_FAT ++#define CONFIG_CMD_EXT2 ++#define CONFIG_CMD_EXT4 ++ ++#define CONFIG_CMD_CACHE ++#define CONFIG_CMD_GPIO ++ ++/* SDRAM */ ++#define CONFIG_NR_DRAM_BANKS 1 ++#define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS6 ++#define CONFIG_SYS_SDRAM_SIZE 0x04000000 ++ ++#define CONFIG_SYS_INIT_SP_ADDR \ ++ (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE) ++ ++/* No NOR flash */ ++#define CONFIG_SYS_NO_FLASH ++ ++#define CONFIG_SPI_FLASH ++#define CONFIG_SPI_FLASH_SST ++#define CONFIG_OCTONET_SPI ++#define CONFIG_CMD_SF ++ ++ ++/* NAND flash */ ++#ifdef CONFIG_CMD_NAND ++#define CONFIG_NAND_ATMEL ++#define CONFIG_SYS_MAX_NAND_DEVICE 1 ++#define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3 ++#define CONFIG_SYS_NAND_ONFI_DETECTION ++//#define CONFIG_SYS_NAND_DBW_16 ++/* our ALE is AD21 */ ++#define CONFIG_SYS_NAND_MASK_ALE (1 << 21) ++/* our CLE is AD22 */ ++#define CONFIG_SYS_NAND_MASK_CLE (1 << 22) ++#define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14 ++#define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC8 ++#define CONFIG_NAND_ECC_BCH ++#define CONFIG_BCH ++//#define CONFIG_PMECC_CAP 2 ++//#define CONFIG_PMECC_SECTOR_SIZE 512 ++ ++#if 1 ++#define CONFIG_CMD_UBI ++#define CONFIG_CMD_UBIFS ++#define CONFIG_CMD_MTDPARTS ++#define CONFIG_RBTREE ++#define CONFIG_MTD_DEVICE ++#define CONFIG_MTD_PARTITIONS ++#define CONFIG_LZO ++#define CONFIG_CMD_NAND_TRIMFFS ++#endif ++ ++#endif ++ ++/* Ethernet */ ++#define CONFIG_CMD_MII ++#define CONFIG_MACB ++#define CONFIG_NET_RETRY_COUNT 20 ++#define CONFIG_RESET_PHY_R ++#define CONFIG_OCTONET ++ ++#ifdef CONFIG_CMD_USB ++/* USB */ ++#define CONFIG_USB_EHCI ++#define CONFIG_USB_EHCI_ATMEL ++#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 ++#define CONFIG_USB_STORAGE ++#endif ++#define CONFIG_DOS_PARTITION ++ ++#define CONFIG_SYS_LOAD_ADDR 0x72000000 /* load address */ ++ ++#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE ++#define CONFIG_SYS_MEMTEST_END 0x23e00000 ++ ++/* bootstrap + u-boot + env in nandflash */ ++#define CONFIG_ENV_IS_IN_NAND ++#define CONFIG_ENV_OFFSET 0xa0000 ++#define CONFIG_ENV_OFFSET_REDUND 0xc0000 ++#define CONFIG_ENV_SIZE 0x20000 ++ ++#define CONFIG_ENV_OVERWRITE ++ ++#if 0 ++#define CONFIG_BOOTCOMMAND "tftp lx.on;bootm" ++#define CONFIG_BOOTARGS \ ++ "root=/dev/nfs nfsroot=/usr3/DOCKSTAR/192.168.2.97.big ip=dhcp console=ttyS0,115200 earlyprintk " ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "newbit=sf probe; tftp net.bit; sf erase 10000 a0000; sf write 72000000 10000 a0000\0" \ ++ "newsbs=sf probe; tftp bs.on; sf erase 4000 2000; sf write 72000000 4000 2000\0" \ ++ "newsub=sf probe; tftp ub.on; sf erase b0000 80000; sf write 72000000 b0000 80000\0" \ ++ "newbs=tftp bsn.on; nand erase 0 20000; nand write 72000000 0 20000\0" \ ++ "newub=tftp ub.on; nand erase 20000 80000; nand write 72000000 20000 80000\0" \ ++ "ipaddr=192.168.2.80\0" \ ++ "nandboot=nand read 72000000 100000 800000; bootm\0" \ ++ "serverip=192.168.2.32\0" ++ ++#else ++ ++#define CONFIG_BOOTCOMMAND "nand erase 0 800000; usb start; usb start; fatload usb 0 72000000 bs.nand; nand write 72000000 0 20000; fatload usb 0 72000000 ub.on; nand write 72000000 20000 80000; fatload usb 0 72000000 uimage; nand write 72000000 100000 800000; setenv bootcmd $nandboot; save" ++//#define CONFIG_BOOTARGS "ip=dhcp console=ttyS0,115200 earlyprintk " ++#define CONFIG_BOOTARGS "ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs console=ttyS0,115200" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "recover=if gpio input 64; then nand erase 2000000 e000000; fi\0" \ ++ "fallback=nand read 72000000 100000 800000; bootm\0" \ ++ "ubiboot=ubi part ubi && ubifsmount ubi:rootfs && ubifsload 72000000 /boot/uImage && bootm\0" \ ++ "nandboot=dcache on; run recover; run ubiboot; run fallback\0" \ ++ "mtdids=nand0=nand_mtd\0" \ ++ "mtdparts=mtdparts=nand_mtd:0x2000000@0x000000(boot),0xe000000@0x2000000(ubi)\0" \ ++ "newbit=sf probe && tftp net.bit && sf erase 10000 a0000 && sf write 72000000 10000 a0000\0" \ ++ "newsbs=sf probe && tftp bs.on && sf erase 4000 2000 && sf write 72000000 4000 2000\0" \ ++ "newsub=sf probe && tftp ub.on && sf erase b0000 80000 && sf write 72000000 b0000 80000\0" \ ++ "newbs=tftp bsn.on; nand erase 0 20000; nand write 72000000 0 20000\0" \ ++ "newub=tftp ub.on && nand erase 20000 80000 && nand write 72000000 20000 80000\0" ++#endif ++ ++ ++#define CONFIG_BAUDRATE 115200 ++ ++#define CONFIG_SYS_PROMPT "OctoNet> " ++#define CONFIG_SYS_CBSIZE 256 ++#define CONFIG_SYS_MAXARGS 16 ++#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) ++#define CONFIG_SYS_LONGHELP ++#define CONFIG_CMDLINE_EDITING ++#define CONFIG_AUTO_COMPLETE ++#define CONFIG_SYS_HUSH_PARSER ++ ++ ++/* ++ * Size of malloc() pool ++ */ ++//#define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000) ++#define CONFIG_SYS_MALLOC_LEN 0x400000 ++ ++#define CONFIG_STACKSIZE (32*1024) /* regular stack */ ++ ++#ifdef CONFIG_USE_IRQ ++#error CONFIG_USE_IRQ not supported ++#endif ++ ++#define CONFIG_MISC_INIT_R ++ ++#endif