Browse Source

remove old sources minisatip

master
mango 2 years ago
parent
commit
68654c07a4
71 changed files with 0 additions and 23265 deletions
  1. +0
    -5
      m/minisatip-0.5.69-476-gbd493b1/.gitignore
  2. +0
    -1
      m/minisatip-0.5.69-476-gbd493b1/.pc/.quilt_patches
  3. +0
    -1
      m/minisatip-0.5.69-476-gbd493b1/.pc/.quilt_series
  4. +0
    -1
      m/minisatip-0.5.69-476-gbd493b1/.pc/.version
  5. +0
    -0
      m/minisatip-0.5.69-476-gbd493b1/.pc/applied-patches
  6. +0
    -98
      m/minisatip-0.5.69-476-gbd493b1/Makefile.in
  7. +0
    -204
      m/minisatip-0.5.69-476-gbd493b1/README.md
  8. +0
    -1857
      m/minisatip-0.5.69-476-gbd493b1/adapter.c
  9. +0
    -160
      m/minisatip-0.5.69-476-gbd493b1/adapter.h
  10. +0
    -90
      m/minisatip-0.5.69-476-gbd493b1/aes.c
  11. +0
    -656
      m/minisatip-0.5.69-476-gbd493b1/ca.c
  12. +0
    -10
      m/minisatip-0.5.69-476-gbd493b1/ca.h
  13. +0
    -5372
      m/minisatip-0.5.69-476-gbd493b1/configure
  14. +0
    -191
      m/minisatip-0.5.69-476-gbd493b1/configure.ac
  15. +0
    -85
      m/minisatip-0.5.69-476-gbd493b1/csa.c
  16. +0
    -63
      m/minisatip-0.5.69-476-gbd493b1/debian/README.Debian
  17. +0
    -2122
      m/minisatip-0.5.69-476-gbd493b1/debian/changelog
  18. +0
    -1
      m/minisatip-0.5.69-476-gbd493b1/debian/compat
  19. +0
    -13
      m/minisatip-0.5.69-476-gbd493b1/debian/control
  20. +0
    -36
      m/minisatip-0.5.69-476-gbd493b1/debian/copyright
  21. +0
    -103
      m/minisatip-0.5.69-476-gbd493b1/debian/default/minisatip
  22. +0
    -1
      m/minisatip-0.5.69-476-gbd493b1/debian/docs
  23. +0
    -57
      m/minisatip-0.5.69-476-gbd493b1/debian/get-new-snapshot.sh
  24. +0
    -3
      m/minisatip-0.5.69-476-gbd493b1/debian/install
  25. +0
    -79
      m/minisatip-0.5.69-476-gbd493b1/debian/minisatip.init
  26. +0
    -44
      m/minisatip-0.5.69-476-gbd493b1/debian/minisatip.upstart
  27. +0
    -16
      m/minisatip-0.5.69-476-gbd493b1/debian/rules
  28. +0
    -1
      m/minisatip-0.5.69-476-gbd493b1/debian/source/format
  29. +0
    -1145
      m/minisatip-0.5.69-476-gbd493b1/dvb.c
  30. +0
    -245
      m/minisatip-0.5.69-476-gbd493b1/dvb.h
  31. +0
    -1142
      m/minisatip-0.5.69-476-gbd493b1/dvbapi.c
  32. +0
    -129
      m/minisatip-0.5.69-476-gbd493b1/dvbapi.h
  33. +0
    -53
      m/minisatip-0.5.69-476-gbd493b1/html/dLAN.xml
  34. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/dvbc.png
  35. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/dvbc2.png
  36. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/dvbs.png
  37. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/dvbs2.png
  38. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/dvbs2x.png
  39. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/dvbt.png
  40. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/dvbt2.png
  41. +0
    -5
      m/minisatip-0.5.69-476-gbd493b1/html/jquery-1.12.0.min.js
  42. +0
    -1
      m/minisatip-0.5.69-476-gbd493b1/html/jquery.dataTables.min.css
  43. +0
    -166
      m/minisatip-0.5.69-476-gbd493b1/html/jquery.dataTables.min.js
  44. +0
    -5
      m/minisatip-0.5.69-476-gbd493b1/html/jquery.pBar.min.js
  45. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/lr.jpg
  46. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/lr.png
  47. +0
    -2
      m/minisatip-0.5.69-476-gbd493b1/html/satip.xml
  48. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/sm.jpg
  49. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/sm.png
  50. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/sort_asc.png
  51. BIN
      m/minisatip-0.5.69-476-gbd493b1/html/sort_both.png
  52. +0
    -316
      m/minisatip-0.5.69-476-gbd493b1/html/status.html
  53. +0
    -1500
      m/minisatip-0.5.69-476-gbd493b1/minisatip.c
  54. +0
    -90
      m/minisatip-0.5.69-476-gbd493b1/minisatip.h
  55. +0
    -560
      m/minisatip-0.5.69-476-gbd493b1/netceiver.c
  56. +0
    -34
      m/minisatip-0.5.69-476-gbd493b1/netceiver.h
  57. +0
    -202
      m/minisatip-0.5.69-476-gbd493b1/netceiver_mcli_defs.h
  58. +0
    -30
      m/minisatip-0.5.69-476-gbd493b1/readme_footer
  59. +0
    -27
      m/minisatip-0.5.69-476-gbd493b1/readme_header
  60. +0
    -1118
      m/minisatip-0.5.69-476-gbd493b1/satipc.c
  61. +0
    -9
      m/minisatip-0.5.69-476-gbd493b1/satipc.h
  62. +0
    -1249
      m/minisatip-0.5.69-476-gbd493b1/socketworks.c
  63. +0
    -95
      m/minisatip-0.5.69-476-gbd493b1/socketworks.h
  64. +0
    -1310
      m/minisatip-0.5.69-476-gbd493b1/stream.c
  65. +0
    -85
      m/minisatip-0.5.69-476-gbd493b1/stream.h
  66. +0
    -1035
      m/minisatip-0.5.69-476-gbd493b1/tables.c
  67. +0
    -71
      m/minisatip-0.5.69-476-gbd493b1/tables.h
  68. +0
    -8
      m/minisatip-0.5.69-476-gbd493b1/tools/gen_readme
  69. +0
    -1238
      m/minisatip-0.5.69-476-gbd493b1/utils.c
  70. +0
    -125
      m/minisatip-0.5.69-476-gbd493b1/utils.h
  71. BIN
      m/minisatip_0.5.69-476-gbd493b1.orig.tar.xz

+ 0
- 5
m/minisatip-0.5.69-476-gbd493b1/.gitignore View File

@@ -1,5 +0,0 @@
/minisatip
*.o
config.log
config.status
Makefile

+ 0
- 1
m/minisatip-0.5.69-476-gbd493b1/.pc/.quilt_patches View File

@@ -1 +0,0 @@
debian/patches

+ 0
- 1
m/minisatip-0.5.69-476-gbd493b1/.pc/.quilt_series View File

@@ -1 +0,0 @@
series

+ 0
- 1
m/minisatip-0.5.69-476-gbd493b1/.pc/.version View File

@@ -1 +0,0 @@
2

+ 0
- 0
m/minisatip-0.5.69-476-gbd493b1/.pc/applied-patches View File


+ 0
- 98
m/minisatip-0.5.69-476-gbd493b1/Makefile.in View File

@@ -1,98 +0,0 @@

AUTOMAKE_OPTIONS = foreign

[email protected]@
[email protected]@
[email protected]@
[email protected]@
[email protected]@
[email protected]@
[email protected]@
[email protected]@
[email protected]@
[email protected]@

CFLAGS?=-ggdb -fPIC $(EXTRA_CFLAGS) @[email protected]
LDFLAGS?=-lpthread -lrt @[email protected]

OBJS=minisatip.o socketworks.o stream.o adapter.o utils.o

TABLES=0

ifeq ($(DVBAES),1)
LIBS+=crypto
OBJS+=aes.o
TABLES=1
else
CFLAGS+=-DDISABLE_DVBAES
endif

ifeq ($(DVBCSA),1)
LIBS+=dvbcsa
OBJS+=csa.o
TABLES=1
else
CFLAGS+=-DDISABLE_DVBCSA
endif

ifeq ($(DVBAPI),1)
OBJS+=dvbapi.o
TABLES=1
else
CFLAGS+=-DDISABLE_DVBAPI
endif

ifeq ($(DVBCA),1)
LIBS+=dvben50221 dvbapi ucsi
OBJS+=ca.o
TABLES=1
else
CFLAGS+=-DDISABLE_DVBCA
endif

ifeq ($(TABLES),1)
OBJS+=tables.o
else
CFLAGS+=-DDISABLE_TABLES
endif

ifeq ($(SATIPCLIENT),1)
OBJS+=satipc.o
else
CFLAGS+=-DDISABLE_SATIPCLIENT
endif

ifeq ($(NETCVCLIENT),1)
OBJS+=netceiver.o
LDFLAGS+=-lmcli -lxml2
else
CFLAGS+=-DDISABLE_NETCVCLIENT
endif

ifeq ($(LINUXDVB),1)
OBJS+=dvb.o
else
CFLAGS+=-DDISABLE_LINUXDVB
OBJS+=dvb.o
endif

ifeq ($(EMBEDDED),1)
CFLAGS+=-DNO_BACKTRACE
endif

ifeq ($(STATIC),1)
LDFLAGS+=$(addsuffix .a,$(addprefix -l:lib,$(LIBS)))
else
LDFLAGS+=$(addprefix -l,$(LIBS))
endif

minisatip: $(OBJS)
$(CC) $(CFLAGS) -o [email protected] $(OBJS) $(LDFLAGS)

%.o : %.c
$(CC) $(CFLAGS) -c $< -o [email protected]

all: minisatip

clean:
rm *.o minisatip >> /dev/null

+ 0
- 204
m/minisatip-0.5.69-476-gbd493b1/README.md View File

@@ -1,204 +0,0 @@
# Welcome to Minisatip

Minisatip is a multi-threaded satip server version 1.2 that runs under Linux and it was tested with DVB-S, DVB-S2, DVB-T, DVB-T2, DVB-C, DVB-C2, ATSC and ISDB-T cards.

The protocol specification can be found at:
http://satip.info/sites/satip/files/resource/satip_specification_version_1_2_2.pdf
It is very lightweight (designed for embedded systems with memory and processing constrains), does not need any additional libraries for basic functionality and can be used by existing satip clients like: Tvheadend, DVBViewer, vdr, VideoLAN or Android/iOS applications. Minisatip can act as a satip client as well in order to connect to satip servers from different networks.

The application is designed to stream the requested data to multiple clients (even with one dvb card) in the same time while opening different pids.

It is tested on x86_64, x86, ARM and MIPS platforms and it requires DVBAPI 5. Supported protocols are RTSP (both tcp and udp), HTTP (port 8080) and SSDP (as specified in the SAT>IP documentation). On top of that, it supports dvbapi protocol implemented by oscam (requires dvbcsa library) to decrypt channels using an official subscription and support dvbca protocol (requires dvben50221 library) for dvb cards with CA hardware. In order to enable/disable features, please edit the Makefile.

The application shows also a status page by default at the address: http://IP:8080
The latest binaries for embedded platforms: https://minisatip.org/forum/viewtopic.php?f=5&t=371

Contact
-------
Please use https://minisatip.org/forum/ for any questions.

In order to speed up the investigation of an issue, please provide the full log and a link to the application that is not working.

If you like minisatip and you want to support the development of the project please make a donation:
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7UWQ7FXSABUH8&item_name=minisatip&currency_code=EUR&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest

Usage:
-------

minisatip version 0.5.66, compiled with s2api version: 050A
[15/11 22:00:36.518 main]: Built with dvbcsa
[15/11 22:00:36.518 main]: Built with CI
[15/11 22:00:36.518 main]: Built with dvbapi
[15/11 22:00:36.518 main]: Built with AES (OpenSSL)
[15/11 22:00:36.518 main]: Built with tables processing
[15/11 22:00:36.518 main]: Built with satip client
[15/11 22:00:36.518 main]: Built with linux dvb client
[15/11 22:00:36.518 main]: Built with backtrace
[15/11 22:00:36.518 main]: Built with netceiver

./minisatip [-[fgltzE]] [-a x:y:z] [-b X:Y] [-B X] [-d A:C-U ] [-D device_id] [-e X-Y,Z] [-i prio]
[-[uj] A1:S1-F1[-PIN]] [-m mac] [-P port][-o oscam_host:dvbapi_port] [-p public_host] [-r remote_rtp_host]
[-R document_root] [-s [DELSYS:]host[:port] [-u A1:S1-F1[-PIN]] [-L A1:low-high-switch] [-w http_server[:port]]
[-x http_port] [-X xml_path] [-y rtsp_port]

Help
-------

* -a x:y:z simulate x DVB-S2, y DVB-T2 and z DVB-C adapters on this box (0 means auto-detect)
* eg: -a 1:2:3
- it will report 1 dvb-s2 device, 2 dvb-t2 devices and 3 dvb-c devices

* -b --buffers X:Y : set the app adapter buffer to X Bytes (default: 25004) and set the kernel DVB buffer to Y Bytes (default: 5775360) - both multiple of 188
* eg: -b 18800:18988

* -B X : set the app socket write buffer to X KB.
The buffer will be split between multiple sockets, each getting maximum X/2 KB
* eg: -B 10

* -d --diseqc ADAPTER1:COMMITTED1-UNCOMMITTED1[,ADAPTER2:COMMITTED2-UNCOMMITTED2[,...]
* The first argument is the adapter number, second is the number of committed packets to send to a Diseqc 1.0 switch, third the number of uncommitted commands to sent to a Diseqc 1.1 switch
The higher number between the committed and uncommitted will be sent first.
* eg: -d 0:1-0 (which is the default for each adapter).
- note: * as adapter means apply to all adapters
- note: * before committed number enables fast-switch (only voltage/tone)

* -q --diseqc-timing ADAPTER1:BEFORE_CMD1-AFTER_CMD1-AFTER_REPEATED_CMD1-AFTER_SWITCH1-AFTER_BURST1-AFTER_TONE1[,...]
* All timing values are in ms, default adapter values are: 15-54-15-15-15-0
- note: * as adapter means apply to all adapters

* -D --device-id DVC_ID: specify the device id (in case there are multiple SAT>IP servers in the network)
* eg: -D 4

* -E Allow encrypted stream to be sent to the client even if the decrypting was unsuccessfull
* -Y --delsys ADAPTER1:DELIVERY_SYSTEM1[,ADAPTER2:DELIVERY_SYSTEM2[,..]] - specify the delivery system of the adapters
* eg: --delsys 1:dvbt,2:dvbs
- specifies adapter 1 as a DVBT device, adapter 2 as DVB-S, which overrides the system detection of the adapter

* --dmx-source ADAPTER1:FRONTENDX - specifies the frontend number specified as argument for DMX_SET_SOURCE
* eg: --dmx-source 0:1 - enables DMX_SET_SOURCE ioctl call with parameter 1 for adapter 0

* -e --enable-adapters list_of_enabled adapters: enable only specified adapters
* eg: -e 0-2,5,7 (no spaces between parameters)
- keep in mind that the first adapters are the local ones starting with 0 after that are the satip adapters
if you have 3 local dvb cards 0-2 will be the local adapters, 3,4, ... will be the satip servers specified with argument -s

* -f foreground, otherwise run in background

* -g use syslog instead stdout for logging, multiple -g - print to stderr as well

* -i --priority prio: set the DVR thread priority to prio

* -l increases the verbosity (you can use multiple -l), logging to stdout in foreground mode or in /tmp/log when a daemon
* eg: -l -l -l

* -L --lnb specifies the adapter and LNB parameters (low, high and switch frequency)
* eg: -L *:9750-10600-11700 - sets all the adapters to use Universal LNB parameters (default)
* eg: -L *:10750-10750-10750 - sets the parameters for Sky NZ LNB using 10750 Mhz
* eg: -L 0:10750-10750-10750,1:9750-10600-11700 - adapter 0 has a SKY NZ LNB, adapter 1 has an Universal LNB

* -m xx: simulate xx as local mac address, generates UUID based on mac
* eg: -m 001122334455

* -Z --nopm ADAPTER1,ADAPTER2-ADAPTER4[,..] - specify no power management for the adapters (does not turn power off)
eg: --nopm 1-2
- turns off power management for adapter 1 to 2
--nopm *
- turns off power management for all adapters (recommended instead of --nopm 0-32)
- required for some Unicable LNBs

* -n --netceiver if:count: use network interface <if> (default vlan4) and look for <count> netceivers
* eg: -n vlan4:2

* -o --dvbapi host:port - specify the hostname and port for the dvbapi server (oscam). Port 9000 is set by default (if not specified)
* eg: -o 192.168.9.9:9000
192.168.9.9 is the host where oscam is running and 9000 is the port configured in dvbapi section in oscam.conf.
* eg: -o /tmp/camd.socket
/tmp/camd.socket is the local socket that can be used

* -p url: specify playlist url using X_SATIPM3U header
* eg: -p http://192.168.2.3:8080/playlist
- this will add X_SATIPM3U tag into the satip description xml

* -P port: use port number to listen for UDP socket in the RTP communication. port + 1000 will be used to listen by the sat>ip client (option -s)
* eg: -P 5500 (default): will use for the sat>ip server 5500 + 2*A and 5500 + 2*A + 1, where A is the adapter number.
6500 + 2*A and 6500 + 2*A + 1 - will be used by the sat>ip client
* -r --remote-rtp remote_rtp_host: send the rtp stream to remote_rtp_host instead of the ip the connection comes from
* eg: -r 192.168.7.9
* -R --document-root directory: document root for the minisatip web page and images

* -s --satip-servers DELSYS:host:port - specify the remote satip host and port with delivery system DELSYS, it is possible to use multiple -s
* DELSYS - can be one of: dvbs, dvbs2, dvbt, dvbt2, dvbc, dvbc2, isdbt, atsc, dvbcb ( - DVBC_ANNEX_B ) [default: dvbs2]
host - the server of the satip server
port - rtsp port for the satip server [default: 554]
eg: -s 192.168.1.2 -s dvbt:192.168.1.3:554 -s dvbc:192.168.1.4
- specifies 1 dvbs2 (and dvbs)satip server with address 192.168.1.2:554
- specifies 1 dvbt satip server with address 192.168.1.3:554
- specifies 1 dvbc satip server with address 192.168.1.4:554

* -O --satip-tcp Use RTSP over TCP instead of UDP for data transport
* -S --slave ADAPTER1,ADAPTER2-ADAPTER4[,..] - specify slave adapters
* Allows specifying bonded adapters (multiple adapters connected with a splitter to the same LNB)
Only one adapter needs to be master all others needs to have this parameter specified
eg: -S 1-2
- specifies adapter 1 to 2 as slave, in this case adapter 0 can be the master that controls the LNB
- the slave adapter will not control the LNB polarity or band, but it will just change the internal frequency to tune to a different transponder
- in this way the master will be responsible for changing the LNB polarity and band

* -t --cleanpsi clean the PSI from all CA information, the client will see the channel as clear if decrypted successfully

* -T --threads: enables/disable multiple threads (reduces memory consumptions) (default: ENABLED)

* -u --unicable unicable_string: defines the unicable adapters (A) and their slot (S), frequency (F) and optionally the PIN for the switch:
* The format is: A1:S1-F1[-PIN][,A2:S2-F2[-PIN][,...]]
eg: 2:0-1284[-1111]
* When * character is used before frequency, force 13V only for setup

* -j --jess jess_string - same format as -u

* -w --http-host http_server[:port]: specify the host and the port (if not 80) where the xml file can be downloaded from [default: default_local_ip_address:8080]
* eg: -w 192.168.1.1:8080

* -x --http-port port: port for listening on http [default: 8080]
* eg: -x 9090

* -X --xml PATH: the path to the xml that is provided as part of the satip protocol
* by default desc.xml is provided by minisatip without needing an additional file,
however satip.xml is included if it needs to be customized

* -y --rtsp-port rtsp_port: port for listening for rtsp requests [default: 554]
* eg: -y 5544
- changing this to a port > 1024 removes the requirement for minisatip to run as root

How to compile:
------

- ./configure

Configures minisatip for the current system (use ./configure --help for options)

To cross compile, use something like (static compilation):

- ./configure --host=mips CC=/usr/src/./configure --host=mips --enable-static CC=/usr/src/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-gcc

To compiles the application

- make

To add custom compilation flags you can use:

make EXTRA_CFLAGS=....

Examples:
-------
- In order to listen to a radio after minisatip is started open the following URL in your favourite media player:
- on Hotbird 13E: "http://MINISATIP_HOST:8080/?msys=dvbs&freq=11623&pol=v&sr=27500&pids=0,10750,254"
- Astra 19.2E: "http://MINISATIP_HOST:8080/?msys=dvbs&freq=12266&pol=h&sr=27500&pids=0,851"

- Television FTA programs:
- Astra 19.2E, Kika HD: "rtsp://MINISATIP_HOST:554/?src=1&freq=11347&pol=v&ro=0.35&msys=dvbs2&mtype=8psk&plts=on&sr=22000&fec=23&pids=0,17,18,6600,6610,6620,6630"

- msys can be one of: dvbs, dvbs2, dvbt, dvbt2, dvbc, dvbc2, atsc, isdbt, dvbcb ( - DVBC_ANNEX_B )


+ 0
- 1857
m/minisatip-0.5.69-476-gbd493b1/adapter.c
File diff suppressed because it is too large
View File


+ 0
- 160
m/minisatip-0.5.69-476-gbd493b1/adapter.h View File

@@ -1,160 +0,0 @@
#ifndef ADAPTER_H
#define ADAPTER_H
#include "minisatip.h"
#include "dvb.h"

typedef struct ca_device ca_device_t;

#define MAX_ADAPTERS 32
#define DVR_BUFFER 30*1024*188
#ifdef NO_BACKTRACE
#define MAX_STREAMS_PER_PID 8
#else
#define MAX_STREAMS_PER_PID 16
#endif
#define ADAPTER_BUFFER (128 + 5)*DVB_FRAME
#define ADAPTER_TIMEOUT 60000

#define TYPE_PMT 1
#define TYPE_ECM 2
#define PMT_COMPLETE 4
#define PMT_SKIPFIRST 8
#define CLEAN_PMT 16

#define RTSP_SETUP 1
#define RTSP_PLAY 2
#define RTSP_OPTIONS 3
#define RTSP_TEARDOWN 4
#define RTSP_DESCRIBE 5

typedef struct struct_pid
{
int16_t pid; // pid for this demux - not used
int fd; // fd for this demux
int err; // counter errors
// stream id - one more to set it -1
signed char sid[MAX_STREAMS_PER_PID];
char flags; // 0 - disabled , 1 enabled, 2 - will be enabled next tune when tune is called, 3 disable when tune is called
char type;
int cnt;
int dec_err; // decrypt errors
unsigned char key, filter, ecm_parity; // custom data kept in the SPid structure
unsigned char cc, version; // continuity
unsigned char enabled_channels; // ca information
uint16_t csid; // channel sid
} SPid;

typedef int (*Set_pid)(void *ad, uint16_t i_pid);
typedef int (*Del_filters)(int fd, int pid);
typedef int (*Adapter_commit)(void *ad);
typedef int (*Open_device)(void *ad);
typedef int (*Device_signal)(void *ad);
typedef int (*Tune)(int aid, transponder * tp);
typedef fe_delivery_system_t (*Dvb_delsys)(int aid, int fd,
fe_delivery_system_t *sys);

#define ADAPTER_DVB 1
#define ADAPTER_SATIP 2
#define ADAPTER_NETCV 3

#define MAX_DELSYS 10

typedef struct struct_adapter
{
char enabled;
SMutex mutex;
char type, slow_dev; // available on the system
int fe, dmx, dvr;
int pa, fn;
// physical adapter, physical frontend number
fe_delivery_system_t sys[MAX_DELSYS];
transponder tp;
SPid pids[MAX_PIDS];
int ca_mask;
int master_sid; // first SID, the one that controls the tuning
int sid_cnt; //number of streams
int sock, fe_sock;
int do_tune;
int force_close;
unsigned char *buf; // 7 rtp packets = MAX_PACK, 7 frames / packet
int rlen;
int64_t rtime;
int64_t last_sort;
int new_gs;
int status, status_cnt;
int dmx_source;
uint32_t ber;
uint16_t strength, snr, max_strength, max_snr;
uint32_t pid_err, dec_err; // detect pids received but not part of any stream, decrypt errors
diseqc diseqc_param;
int old_diseqc;
int old_hiband;
int old_pol;
int id;
int pat_processed, transponder_id, pat_ver;
int wait_new_stream, wait_transponder_id;
uint64_t tune_time;
char name[5];

Set_pid set_pid;
Del_filters del_filters;
Adapter_commit commit;
Open_device open;
Tune tune;
Dvb_delsys delsys;
Device_signal get_signal;
Adapter_commit post_init, close;
} adapter;

extern adapter *a[MAX_ADAPTERS];
extern int a_count;
extern char do_dump_pids;

int init_hw(int dev);
int init_all_hw();
int getAdaptersCount();
adapter *adapter_alloc();
int close_adapter(int na);
int get_free_adapter(transponder *tp);
int set_adapter_for_stream(int i, int a);
void close_adapter_for_stream(int sid, int aid);
int set_adapter_parameters(int aid, int sid, transponder * tp);
void mark_pids_deleted(int aid, int sid, char *pids);
int mark_pids_add(int sid, int aid, char *pids);
int mark_pid_add(int sid, int aid, int _pid);
void mark_pid_deleted(int aid, int sid, int _pid, SPid *p);
int update_pids(int aid);
int tune(int aid, int sid);
SPid *find_pid(int aid, int p);
adapter * get_adapter1(int aid, char *file, int line);
char *describe_adapter(int sid, int aid, char *dad, int ld);
void dump_pids(int aid);
void sort_pids(int aid);
void enable_adapters(char *o);
void set_unicable_adapters(char *o, int type);
void set_diseqc_adapters(char *o);
void set_diseqc_timing(char *o);
void set_slave_adapters(char *o);
void set_nopm_adapters(char *o);
void set_adapter_dmxsource(char *o);
void reset_pids_type(int aid, int clear_pat);
void reset_ecm_type_for_key(int aid, int key);
int delsys_match(adapter *ad, int del_sys);
int get_enabled_pids(adapter *ad, int *pids, int lpids);
int get_active_pids_number(adapter *ad);
int get_all_pids(adapter *ad, int *pids, int lpids);
char *get_adapter_pids(int aid, char *dest, int max_size);
void adapter_lock1(char *FILE, int line, int aid);
void adapter_unlock1(char *FILE, int line, int aid);
char is_adapter_disabled(int i);
void set_adapters_delsys(char *o);
void set_lnb_adapters(char *o);
int signal_thread(sockets *s);
int compare_tunning_parameters(int aid, transponder * tp);

#define get_adapter(a) get_adapter1(a, __FILE__, __LINE__)
#define get_adapter_nw(aid) ((aid >= 0 && aid < MAX_ADAPTERS && a[aid] && a[aid]->enabled)?a[aid]:NULL)

#define adapter_lock(a) adapter_lock1(__FILE__,__LINE__,a)
#define adapter_unlock(a) adapter_unlock1(__FILE__,__LINE__,a)
#endif

+ 0
- 90
m/minisatip-0.5.69-476-gbd493b1/aes.c View File

@@ -1,90 +0,0 @@
/*
- * Copyright (C) 2014-2020 Catalin Toda <[email protected]>
*
* 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 <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <net/if.h>
#include <fcntl.h>
#include <ctype.h>
#include "utils.h"
#include "dvb.h"
#include "socketworks.h"
#include "minisatip.h"
#include "dvbapi.h"
#include "adapter.h"
#include "tables.h"
#include "dvbapi.h"
#include "openssl/aes.h"

extern struct struct_opts opts;

void *dvbaes_create_key()
{
return malloc1(sizeof(AES_KEY));
}

void dvbaes_delete_key(void *key)
{
free1(key);
}

int dvbaes_batch_size() // make sure the number is divisible by 7
{
return 64; // process 64 packets at a time
}

void dvbaes_set_cw(unsigned char *cw, void *key)
{
AES_set_decrypt_key(cw, 128, (AES_KEY *) key);
}

void dvbaes_decrypt_stream(void *key, dvbapi_batch *batch, int max_len)
{
int i, j, len;
for (i = 0; batch[i].data && i < max_len; i++)
{
len = (batch[i].len / 16) * 16;
for (j = 0; j < len; j++)
AES_ecb_encrypt(batch[i].data + j, batch[i].data + j,
(AES_KEY *) key, AES_DECRYPT);

}
}

dvbapi_op aes_op =
{ .algo = CA_ALGO_AES128, .mode = CA_MODE_ECB,
.create_cwkey = dvbaes_create_key, .delete_cwkey = dvbaes_delete_key,
.batch_size = dvbaes_batch_size, .set_cw = dvbaes_set_cw,
.decrypt_stream = dvbaes_decrypt_stream };

+ 0
- 656
m/minisatip-0.5.69-476-gbd493b1/ca.c View File

@@ -1,656 +0,0 @@
/*
* Copyright (C) 2015 Damjan Marion <[email protected]>
* Copyright (C) 2016 Catalin Toda <[email protected]>
*
* 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 <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <fcntl.h>
#include <ctype.h>

#include <libdvben50221/en50221_session.h>
#include <libdvben50221/en50221_app_utils.h>
#include <libdvben50221/en50221_app_ai.h>
#include <libdvben50221/en50221_app_rm.h>
#include <libdvben50221/en50221_app_ca.h>
#include <libdvben50221/en50221_app_dvb.h>
#include <libdvben50221/en50221_app_datetime.h>
#include <libdvben50221/en50221_app_smartcard.h>
#include <libdvben50221/en50221_app_teletext.h>
#include <libdvben50221/en50221_app_mmi.h>
#include <libdvben50221/en50221_app_epg.h>
#include <libdvben50221/en50221_app_auth.h>
#include <libdvben50221/en50221_app_lowspeed.h>
#include <libdvbapi/dvbca.h>

#include "dvb.h"
#include "socketworks.h"
#include "minisatip.h"
#include "dvbapi.h"
#include "adapter.h"
#include "search.h"
#include "ca.h"
#include "utils.h"

#define MAX_MSG_LEN 4096
#define READ_DELAY 0
#define MAX_CA_DEVICES 8
#define MAX_CA_DEVICE_RESOURCES 8

typedef struct ca_device
{
int enabled;
int fd;
int slot_id;
int tc;
int id;
int ignore_close;
pthread_t stackthread;
struct en50221_transport_layer *tl;
struct en50221_session_layer * sl;

struct en50221_app_send_functions sf;
struct en50221_app_rm *rm_resource;
struct en50221_app_ai *ai_resource;
struct en50221_app_ca *ca_resource;
struct en50221_app_datetime *dt_resource;
int ca_session_number;
int ai_version;
int high_bitrate_mode;
uint16_t ai_session_number;
} ca_device_t;
SCA dvbca;

int dvbca_id;
static struct ca_device *ca_devices[MAX_ADAPTERS];
#define TS101699_APP_AI_RESOURCEID MKRID(2, 1, 2)
#define CIPLUS13_APP_AI_RESOURCEID MKRID(2, 1, 3)

typedef enum {
CIPLUS13_DATA_RATE_72_MBPS = 0,
CIPLUS13_DATA_RATE_96_MBPS = 1,
} ciplus13_data_rate_t;

int dvbca_close_device(ca_device_t *c);


static int
ciplus13_app_ai_data_rate_info(ca_device_t *d, ciplus13_data_rate_t rate)
{
uint8_t data[] = {0x9f, 0x80, 0x24, 0x01, (uint8_t) rate};

/* only version 3 (CI+ 1.3) supports data_rate_info */
if (d->ai_version != 3)
return 0;

LOG("setting CI+ CAM data rate to %s Mbps", rate ? "96":"72");

return en50221_sl_send_data(d->sl, d->ai_session_number, data, sizeof(data));
}


// this contains all known resource ids so we can see if the cam asks for something exotic
uint32_t resource_ids[] =
{
EN50221_APP_TELETEXT_RESOURCEID, EN50221_APP_SMARTCARD_RESOURCEID(1),
EN50221_APP_RM_RESOURCEID, EN50221_APP_MMI_RESOURCEID,
EN50221_APP_LOWSPEED_RESOURCEID(1, 1), EN50221_APP_EPG_RESOURCEID(1),
EN50221_APP_DVB_RESOURCEID, EN50221_APP_CA_RESOURCEID,
EN50221_APP_DATETIME_RESOURCEID, EN50221_APP_AUTH_RESOURCEID,
EN50221_APP_AI_RESOURCEID, TS101699_APP_AI_RESOURCEID, CIPLUS13_APP_AI_RESOURCEID
};
int resource_ids_count = sizeof(resource_ids) / 4;

void hexdump(uint8_t buffer[], int len)
{
#define HEXDUMP_LINE_LEN 16
int i;
char s[HEXDUMP_LINE_LEN + 1];
bzero(s, HEXDUMP_LINE_LEN+1);

for (i = 0; i < len; i++)
{
if (!(i % HEXDUMP_LINE_LEN))
{
if (s[0])
LOG("[%s]", s);
LOG("%05x: ", i);
bzero(s, HEXDUMP_LINE_LEN);
}
s[i % HEXDUMP_LINE_LEN] = isprint(buffer[i]) ? buffer[i] : '.';
LOG("%02x ", buffer[i]);
}
while (i++ % HEXDUMP_LINE_LEN)
LOG(" ");

LOG("[%s]", s);
}

int dvbca_process_pmt(adapter *ad, void *arg)
{
ca_device_t * d = ca_devices[ad->id];
uint16_t pid, sid, ver;
SPid *p;
int len, rc;
SPMT *spmt = (SPMT *) arg;
uint8_t *b = spmt->pmt;

if (!d)
return -1;

pid = spmt->pid;
len = spmt->pmt_len;

ver = (b[5] >> 1) & 0x1f;
sid = (b[3] << 8) | b[4];

LOG("PMT CA pid %u len %u ver %u sid %u (%x)", pid, len, ver, sid, sid);
uint8_t capmt[4096];
int size;
struct section *section = section_codec(b, len + 3);

if (!section)
{
LOG("failed to decode section");
return -1;
}

struct section_ext *result = section_ext_decode(section, 0);
if (!section)
{
LOG("failed to decode ext_section");
return -1;
}

struct mpeg_pmt_section *pmt = mpeg_pmt_section_codec(result);
if (!pmt)
{
LOG("failed to decode pmt");
return -1;
}

if ((size = en50221_ca_format_pmt((struct mpeg_pmt_section *) b, capmt,
sizeof(capmt), 0, CA_LIST_MANAGEMENT_ONLY,
CA_PMT_CMD_ID_OK_DESCRAMBLING)) < 0)
LOG("Failed to format CA PMT object");
if ((rc = en50221_app_ca_pmt(d->ca_resource, d->ca_session_number, capmt,
size)))
{
LOG("Adapter %d, Failed to send CA PMT object, error %d", ad->id, rc);
}
// hexdump(&capmt[0], size);

return 0;
}

void dvbca_del_pmt(adapter *ad, void *arg)
{

}

int ca_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)
{
ca_device_t * d = arg;

LOG("%02x:%s", slot_id, __func__);
LOG(" Application type: %02x", application_type);
LOG(" Application manufacturer: %04x", application_manufacturer);
LOG(" Manufacturer code: %04x", manufacturer_code);
LOG(" Menu string: %.*s", menu_string_length, menu_string);

d->ai_session_number = session_number;

return 0;
}

extern __thread char *thread_name;
void *
stackthread_func(void* arg)
{
char name[100];
ca_device_t * d = arg;
int lasterror = 0;
adapter *ad;
sprintf(name, "CA%d", d->id);
thread_name = name;
LOG("%s: start", __func__);

while (d->enabled)
{
int error;
if ((error = en50221_tl_poll(d->tl)) != 0)
{
if (error != lasterror)
{
LOG("Error reported by stack slot:%i error:%i",
en50221_tl_get_error_slot(d->tl),
en50221_tl_get_error(d->tl));
ad = get_adapter(d->id);
if(ad)
ad->slow_dev = 0;
d->ignore_close = 0; // force device close..
//break;
}
lasterror = error;
}
}

return 0;
}

static int ca_session_callback(void *arg, int reason, uint8_t slot_id,
uint16_t session_number, uint32_t resource_id)
{
ca_device_t * d = arg;
LOG("%s: reason %d slot_id %u session_number %u resource_id %x", __func__,
reason, slot_id, session_number, resource_id);

switch (reason)
{
case S_SCALLBACK_REASON_CAMCONNECTING:
LOG("CAM connecting")
break;
case S_SCALLBACK_REASON_CAMCONNECTED:
LOG("CAM connected")

if (resource_id == EN50221_APP_RM_RESOURCEID)
{
en50221_app_rm_enq(d->rm_resource, session_number);
}
else if (resource_id == EN50221_APP_AI_RESOURCEID || resource_id == TS101699_APP_AI_RESOURCEID || resource_id == CIPLUS13_APP_AI_RESOURCEID)
{
d->ai_version = resource_id & 0x3f;
d->ai_session_number = session_number;
en50221_app_ai_enquiry(d->ai_resource, session_number);
ciplus13_app_ai_data_rate_info(d, d->high_bitrate_mode ?
CIPLUS13_DATA_RATE_96_MBPS :
CIPLUS13_DATA_RATE_72_MBPS );
}
else if (resource_id == EN50221_APP_CA_RESOURCEID)
{
en50221_app_ca_info_enq(d->ca_resource, session_number);
d->ca_session_number = session_number;
}
d->ignore_close = 1;
unregister_ca_for_adapter(dvbca_id, d->id);
register_ca_for_adapter(dvbca_id, d->id);
break;
}
return 0;
}

static int ca_lookup_callback(void * arg, uint8_t slot_id,
uint32_t requested_resource_id,
en50221_sl_resource_callback *callback_out, void **arg_out,
uint32_t *connected_resource_id)
{
ca_device_t * d = arg;

LOG("%s: slot_id %u requested_resource_id %x", __func__, slot_id,
requested_resource_id);

switch (requested_resource_id)
{
case EN50221_APP_RM_RESOURCEID:
*callback_out = (en50221_sl_resource_callback) en50221_app_rm_message;
*arg_out = d->rm_resource;
*connected_resource_id = EN50221_APP_RM_RESOURCEID;
break;
case EN50221_APP_AI_RESOURCEID:
*callback_out = (en50221_sl_resource_callback) en50221_app_ai_message;
*arg_out = d->ai_resource;
*connected_resource_id = EN50221_APP_AI_RESOURCEID;
break;
case EN50221_APP_CA_RESOURCEID:
*callback_out = (en50221_sl_resource_callback) en50221_app_ca_message;
*arg_out = d->ca_resource;
*connected_resource_id = EN50221_APP_CA_RESOURCEID;
break;
case EN50221_APP_DATETIME_RESOURCEID:
*callback_out =
(en50221_sl_resource_callback) en50221_app_datetime_message;
*arg_out = d->dt_resource;
*connected_resource_id = EN50221_APP_DATETIME_RESOURCEID;
break;
case TS101699_APP_AI_RESOURCEID:
case CIPLUS13_APP_AI_RESOURCEID:
*callback_out = (en50221_sl_resource_callback) en50221_app_ai_message;
*arg_out = d->ai_resource;
*connected_resource_id = requested_resource_id;
break;
default:
LOG("unknown resource id")
;
return -1;
}
return 0;
}

static int ca_rm_enq_callback(void *arg, uint8_t slot_id,
uint16_t session_number)
{
ca_device_t * d = arg;

LOG("%02x:%s", slot_id, __func__);

if (en50221_app_rm_reply(d->rm_resource, session_number, resource_ids_count,
resource_ids))
{
LOG("%02x:Failed to send reply to ENQ", slot_id);
}

return 0;
}

static int ca_rm_reply_callback(void *arg, uint8_t slot_id,
uint16_t session_number, uint32_t resource_id_count,
uint32_t *_resource_ids)
{
ca_device_t * d = arg;
LOG("%02x:%s", slot_id, __func__);

uint32_t i;
for (i = 0; i < resource_id_count; i++)
{
LOG(" CAM provided resource id: %08x", _resource_ids[i]);
}

if (en50221_app_rm_changed(d->rm_resource, session_number))
{
LOG("%02x:Failed to send REPLY", slot_id);
}

return 0;
}

static int ca_rm_changed_callback(void *arg, uint8_t slot_id,
uint16_t session_number)
{
ca_device_t * d = arg;
LOG("%02x:%s", slot_id, __func__);

if (en50221_app_rm_enq(d->rm_resource, session_number))
{
LOG("%02x:Failed to send ENQ", slot_id);
}

return 0;
}

static int ca_ca_info_callback(void *arg, uint8_t slot_id,
uint16_t session_number, uint32_t ca_id_count, uint16_t *ca_ids)
{
(void) arg;
(void) session_number;

LOG("%02x:%s", slot_id, __func__);
uint32_t i;
for (i = 0; i < ca_id_count; i++)
{
LOG(" Supported CA ID: %04x", ca_ids[i]);
}

//ca_connected = 1;
return 0;
}

static int ca_ca_pmt_reply_callback(void *arg, uint8_t slot_id,
uint16_t session_number, struct en50221_app_pmt_reply *reply,
uint32_t reply_size)
{
(void) arg;
(void) session_number;
(void) reply;
(void) reply_size;

LOG("%02x:%s", slot_id, __func__);

return 0;
}

static int ca_dt_enquiry_callback(void *arg, uint8_t slot_id,
uint16_t session_number, uint8_t response_interval)
{
ca_device_t * d = arg;

LOG("%02x:%s", slot_id, __func__);
LOG(" response_interval:%i", response_interval);

if (en50221_app_datetime_send(d->dt_resource, session_number, time(NULL),
-1))
{
LOG("%02x:Failed to send datetime", slot_id);
}

return 0;
}

int ca_init(ca_device_t *d)
{
ca_slot_info_t info;
int64_t st = getTick();
info.num = 0;
int tries = 800; // wait up to 8s for the CAM
int fd = d->fd;

d->tl = NULL;
d->sl = NULL;
d->slot_id = -1;

adapter *ad = get_adapter(d->id);

if (ioctl(fd, CA_RESET, &info))
LOG_AND_RETURN(0, "%s: Could not reset ca %d", __FUNCTION__, d->id);

do
{
if (ioctl(fd, CA_GET_SLOT_INFO, &info))
LOG_AND_RETURN(0, "%s: Could not get info1 for ca %d", __FUNCTION__, d->id);
usleep(10000);
} while (tries-- && !(info.flags & CA_CI_MODULE_READY));

if (ioctl(fd, CA_GET_SLOT_INFO, &info))
LOG_AND_RETURN(0, "%s: Could not get info2 for ca %d", __FUNCTION__, d->id);

LOG("initializing CA, fd %d type %d flags 0x%x, after %jd ms", fd, info.type, info.flags, (getTick() - st));

if (info.type != CA_CI_LINK)
{
LOG("incompatible CA interface");
goto fail;
}

if (!(info.flags & CA_CI_MODULE_READY))
{
LOG("CA module not present or not ready");
goto fail;
}

if ((d->tl = en50221_tl_create(5, 32)) == NULL)
{
LOG("failed to create transport layer");
goto fail;
}

if ((d->slot_id = en50221_tl_register_slot(d->tl, fd, 0, 10000, 1000)) < 0)
{
LOG("slot registration failed");
goto fail;
}
LOG("slotid: %i", d->slot_id);

// create session layer
d->sl = en50221_sl_create(d->tl, 256);
if (d->sl == NULL)
{
LOG("failed to create session layer");
goto fail;
}

// create the sendfuncs
d->sf.arg = d->sl;
d->sf.send_data = (en50221_send_data) en50221_sl_send_data;
d->sf.send_datav = (en50221_send_datav) en50221_sl_send_datav;

/* create app resources and assign callbacks */
d->rm_resource = en50221_app_rm_create(&d->sf);
en50221_app_rm_register_enq_callback(d->rm_resource, ca_rm_enq_callback, d);
en50221_app_rm_register_reply_callback(d->rm_resource, ca_rm_reply_callback,
d);
en50221_app_rm_register_changed_callback(d->rm_resource,
ca_rm_changed_callback, d);

d->dt_resource = en50221_app_datetime_create(&d->sf);
en50221_app_datetime_register_enquiry_callback(d->dt_resource,
ca_dt_enquiry_callback, d);

d->ai_resource = en50221_app_ai_create(&d->sf);
en50221_app_ai_register_callback(d->ai_resource, ca_ai_callback, d);

d->ca_resource = en50221_app_ca_create(&d->sf);
en50221_app_ca_register_info_callback(d->ca_resource, ca_ca_info_callback,
d);
en50221_app_ca_register_pmt_reply_callback(d->ca_resource,
ca_ca_pmt_reply_callback, d);

pthread_create(&d->stackthread, NULL, stackthread_func, d);

en50221_sl_register_lookup_callback(d->sl, ca_lookup_callback, d);
en50221_sl_register_session_callback(d->sl, ca_session_callback, d);

d->tc = en50221_tl_new_tc(d->tl, d->slot_id);
LOG("tcid: %i", d->tc);

return 1;
fail: close(fd);
d->enabled = 0;
return 0;
}

int dvbca_init_dev(adapter *ad, void *arg)
{
ca_device_t *c = ca_devices[ad->id];
int fd;
int init_ok = 0;
char ca_dev_path[100];

if (c && c->enabled)
return 1;

if (ad->type != ADAPTER_DVB)
return 0;

sprintf(ca_dev_path, "/dev/dvb/adapter%d/ca0", ad->pa);
fd = open(ca_dev_path, O_RDWR);
if (fd <= 0)
LOG_AND_RETURN(0, "No CA device detected on adapter %d", ad->id);
if (!c)
{
c = ca_devices[ad->id] = malloc1(sizeof(ca_device_t));
if (!c)
LOG_AND_RETURN(0, "Could not allocate memory for CA device %d",
ad->id);
memset(c, 0, sizeof(ca_device_t));
}
c->enabled = 1;
c->ignore_close = 0;
c->fd = fd;
c->id = ad->id;
c->high_bitrate_mode = 0;
c->stackthread = 0;
init_ok = ca_init(c);
if(!init_ok)
{
dvbca_close_device(c);
return 0;
}
return 1;
}

int dvbca_close_device(ca_device_t *c)
{
LOG("closing CA device %d, fd %d", c->id, c->fd);
c->enabled = 0;
if(c->stackthread)
pthread_join(c->stackthread, NULL);
if(c->tl && (c->slot_id >= 0))
en50221_tl_destroy_slot(c->tl, c->slot_id);
if(c->sl)
en50221_sl_destroy(c->sl);
if(c->tl >= 0)
en50221_tl_destroy(c->tl);
if(c->fd >= 0)
close(c->fd);

}
int dvbca_close_dev(adapter *ad, void *arg)
{
ca_device_t *c = ca_devices[ad->id];
if (c && c->enabled && !c->ignore_close) // do not close the CA unless in a bad state
{
dvbca_close_device(c);
}
return 1;
}

void dvbca_close(adapter *ad, void *arg)
{
int i;
adapter tmp_ad;
for(i=0;i<MAX_ADAPTERS;i++)
if(ca_devices[i] && ca_devices[i]->enabled)
{
dvbca_close_device(ca_devices[i]);
}

}

void dvbca_init() // you can search the devices here and fill the ca_devices, then open them here (for example independent CA devices), or use dvbca_init_dev to open them (like in this module)
{
memset(dvbca.action, 0, sizeof(dvbca.action));
dvbca.enabled = 1; // ignore it anyway
dvbca.action[CA_INIT_DEVICE] = (ca_action) &dvbca_init_dev;
dvbca.action[CA_CLOSE_DEVICE] = (ca_action) &dvbca_close_dev;
dvbca.action[CA_ADD_PMT] = (ca_action) &dvbca_process_pmt;
dvbca.action[CA_DEL_PMT] = (ca_action) &dvbca_del_pmt;
dvbca.action[CA_CLOSE] = (ca_action) &dvbca_close;
dvbca.adapter_mask = 0xFFFFFFFF; // enabled for all the adapters
dvbca_id = add_ca(&dvbca);
}

+ 0
- 10
m/minisatip-0.5.69-476-gbd493b1/ca.h View File

@@ -1,10 +0,0 @@
#ifndef CA_H
#define CA_H
#include "adapter.h"
#include "tables.h"
int ca_init(ca_device_t *d);
void ca_grab_pmt(adapter *a, int rlen);
int dvbca_process_pmt(adapter *ad, void *arg);
void dvbca_init();

#endif

+ 0
- 5372
m/minisatip-0.5.69-476-gbd493b1/configure
File diff suppressed because it is too large
View File


+ 0
- 191
m/minisatip-0.5.69-476-gbd493b1/configure.ac View File

@@ -1,191 +0,0 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.4])
AC_INIT(minisatip, 0.5, https://github.com/catalinii/minisatip)
AC_CONFIG_SRCDIR([minisatip.h])
# AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lrt':
AC_CHECK_LIB([rt], [main])

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT16_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([bzero clock_gettime dup2 gethostbyname gettimeofday inet_ntoa memset munmap socket strchr strerror strncasecmp strstr])

FM="\nminisatip configuration\n\n"
linux_dvb="Linux DVB:\t\t\t\t "
dvb_csa="DVBCSA (needs libdvbcsa):\t\t "
openssl="OpenSSL (AES as part of DVBAPI):\t "
dvb_ca="Common Interface (needs DVBEN50221):\t "
emb="Embedded system:\t\t\t "
netcv="Netceiver support:\t\t\t "
satipc="SatIP Client:\t\t\t\t "
static="Static:\t\t\t\t\t "
dvbapi="dvbapi:\t\t\t\t\t "

AC_MSG_NOTICE([ == Checking LINUX DVB == ])
AC_CHECK_HEADERS([linux/dvb/frontend.h],[LINUXDVB=1],[LINUXDVB=0])
AC_ARG_ENABLE([linuxdvb],
[AS_HELP_STRING([--disable-linuxdvb],
[disable linux dvb support])],
[LINUXDVB=0],
[LINUXDVB="$LINUXDVB"])

if test "$LINUXDVB" = "1"; then
FM="$FM\n$linux_dvb enabled"
else
FM="$FM\n$linux_dvb disabled"
fi

AC_MSG_NOTICE([ == Checking DVBEN50221 == ])
AC_CHECK_HEADERS([libdvben50221/en50221_app_dvb.h],[DVBCA=1],[DVBCA=0])
AC_ARG_ENABLE([dvbca],
[AS_HELP_STRING([--disable-dvbca],
[disable dvbca support (decrypting using CI)])],
[DVBCA=0],
[DVBCA="$DVBCA"])

if test "$DVBCA" = "1"; then
FM="$FM\n$dvb_ca enabled"
else
FM="$FM\n$dvb_ca disabled"
fi

AC_MSG_NOTICE([ == Checking OpenSSL == ])
AC_CHECK_HEADERS([openssl/aes.h],[DVBAES=1],[DVBAES=0])
AC_ARG_ENABLE([dvbaes],
[AS_HELP_STRING([--disable-dvbaes],
[disable AES support (decrypting using openssl)])],
[DVBAES=0],
[DVBAES="$DVBAES"])

if test "$DVBAES" = "1"; then
FM="$FM\n$openssl enabled"
else
FM="$FM\n$openssl disabled"
fi

AC_MSG_NOTICE([ == Checking Embedded == ])
AC_CHECK_FUNCS([backtrace],[EMBEDDED=0],[EMBEDDED=1])
if test "$EMBEDDED" = "1"; then
FM="$FM\n$emb enabled"
else
FM="$FM\n$emb disabled"
fi

AC_MSG_NOTICE([ == Checking DVBCSA == ])
AC_CHECK_HEADERS([dvbcsa/dvbcsa.h],[DVBCSA=1],[DVBCSA=0])
AC_ARG_ENABLE([dvbcsa],
[AS_HELP_STRING([--disable-dvbcsa],
[disable dvbcsa support (decrypting with dvbcsa)])],
[DVBCSA=0],
[DVBCSA="$DVBCSA"])

if test "$DVBCSA" = "1"; then
FM="$FM\n$dvb_csa enabled"
else
FM="$FM\n$dvb_csa disabled"
fi

AC_MSG_NOTICE([ == Checking NETCVCLIENT == ])

mcli_dir="../vdr-mcli-plugin"
xml2_dir="/usr/include/libxml2"

AC_ARG_WITH([mcli],
[AS_HELP_STRING([--with-mcli],
[specify vdr-mcli-plugin directory default=../vdr-mcli-plugin])],
[mcli_dir=$with_mcli])

AC_ARG_WITH([xml2],
[AS_HELP_STRING([--with-xml2],
[specify libxml2 directory default=/usr/include/libxml2])],
[xml2_dir=$with_xml2])
CFLAGS="-I. -I$mcli_dir/mcast/client -I$mcli_dir/mcast/common -L$mcli_dir/mcast/client -I$xml2_dir"
CPPFLAGS="-I. -I$mcli_dir/mcast/client -I$mcli_dir/mcast/common -L$mcli_dir/mcast/client -I$xml2_dir"


AC_CHECK_HEADERS([netceiver.h],[NETCVCLIENT=1],[NETCVCLIENT=0])
AC_ARG_ENABLE([netcv],
[AS_HELP_STRING([--disable-netceiver],
[disable NETCEIVER support])],
[NETCVCLIENT=0],
[NETCVCLIENT="$NETCVCLIENT"])

if test "$NETCVCLIENT" = "1"; then
FM="$FM\n$netcv enabled"
else
FM="$FM\n$netcv disabled"
CFLAGS=
CPPFLAGS=
fi


AC_ARG_ENABLE([satipc],
[AS_HELP_STRING([--disable-satipc],
[disable satip client support])],
[SATIPCLIENT=0],
[SATIPCLIENT=1])
if test "$SATIPCLIENT" = "1"; then
FM="$FM\n$satipc enabled"
else
FM="$FM\n$satipc disabled"
fi

AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static],
[enable static compilation])],
[STATIC=1],
[STATIC=0])
if test "$STATIC" = "1"; then
FM="$FM\n$static enabled"
else
FM="$FM\n$static disabled"
fi

AC_ARG_ENABLE([dvbapi],
[AS_HELP_STRING([--disable-dvbapi],
[disable dvbapi protocol support])],
[DVBAPI=0],
[DVBAPI=1])
if test "$DVBAPI" = "1"; then
FM="$FM\n$dvbapi enabled"
else
FM="$FM\n$dvbapi disabled"
fi


AC_SUBST(LINUXDVB)
AC_SUBST(DVBCSA)
AC_SUBST(DVBCA)
AC_SUBST(DVBAES)
AC_SUBST(EMBEDDED)
AC_SUBST(NETCVCLIENT)
AC_SUBST(SATIPCLIENT)
AC_SUBST(STATIC)
AC_SUBST(DVBAPI)

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

echo -e "$FM\n"

+ 0
- 85
m/minisatip-0.5.69-476-gbd493b1/csa.c View File

@@ -1,85 +0,0 @@
/*
- * Copyright (C) 2014-2020 Catalin Toda <[email protected]>
*
* 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 <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <net/if.h>
#include <fcntl.h>
#include <ctype.h>
#include "utils.h"
#include "dvb.h"
#include "socketworks.h"
#include "minisatip.h"
#include "dvbapi.h"
#include "adapter.h"
#include "tables.h"
#include "dvbapi.h"
#include <dvbcsa/dvbcsa.h>
extern struct struct_opts opts;
void *dvbcsa_create_key()
{
return (void *) dvbcsa_bs_key_alloc();
}
void dvbcsa_delete_key(void *key)
{
dvbcsa_key_free(key);
}
int dvbcsa_batch_size() // make sure the number is divisible by 7
{
int batchSize = dvbcsa_bs_batch_size();
// batchSize = (batchSize / 7) * 7;
return batchSize;
}
void dvbcsa_set_cw(unsigned char *cw, void *key)
{
dvbcsa_bs_key_set(cw, key);
}
void dvbcsa_decrypt_stream(void *key, dvbapi_batch *batch, int max_len)
{
dvbcsa_bs_decrypt((const struct dvbcsa_bs_key_s *) key,
(const struct dvbcsa_bs_batch_s *) batch, max_len);
}
dvbapi_op csa_op =
{ .algo = CA_ALGO_DVBCSA, .mode = 0, .create_cwkey = dvbcsa_create_key,
.delete_cwkey = dvbcsa_delete_key, .batch_size = dvbcsa_batch_size,
.set_cw = dvbcsa_set_cw, .decrypt_stream = dvbcsa_decrypt_stream };

+ 0
- 63
m/minisatip-0.5.69-476-gbd493b1/debian/README.Debian View File

@@ -1,63 +0,0 @@
Welcome to Minisatip

Minisatip is a single threaded satip server version 1.2 that runs under Linux and it was tested with DVB-S, DVB-S2, DVB-T, DVB-T2, DVB-C, DVB-C2, ATSC DVB cards.
The protocol specification can be found at: satip.info/sites/satip/files/resource/satip_specification_version_1_2_2.pdf
It is very lightweight (designed for embedded systems with memory and processing constrains), does not need any additional libraries for basic functionality and can be used by existing satip clients like: Tvheadend, DVBViewer, vdr or Android/iOS applications. minisatip can act as a satip client as well in order to connect to satip servers from different networks.
The application is designed to stream the requested data to multiple clients (even with one dvb card) in the same time while opening different pids.
It is tested on x86_64, x86, ARM and MIPS platforms and it requires DVBAPI 5. Supported protocols are rtsp (both tcp and udp), HTTP (port 8080) and SSDP (as specified in the SAT>IP documentation). On top of that, it supports dvbapi protocol implemented by oscam (requires dvbcsa library) to decrypt channels using an official subscription and support dvbca protocol (requires dvben50221 library) for dvb cards with CA hardware. In order to enable/disable features, please edit the Makefile.

Please use https://toda.ro/forum/ for any questions.
In order to speed up the investigation of an issue, please provide the full log and a link to the application that is not working.

If you like minisatip and you want to support the development of the project please make a donation:

https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7UWQ7FXSABUH8&item_name=minisatip&currency_code=EUR&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest

Usage:

minisatip [-f] [-r remote_rtp_host] [-d device_id] [-w http_server[:port]] [-p public_host] [-s rtp_port] [-a no] [-m mac] [-l] [-a X:Y:Z] [-e X-Y,Z]
-f foreground, otherwise run in background
-r remote_rtp_host: send remote rtp to remote_rtp_host
-d specify the device id (in case there are multiple SAT>IP servers in the network)
-w http_server[:port]: specify the host and the port where the xml file can be downloaded from
-x port: port for listening on http
-y rtsp_port: port for listening for rtsp requests (default: 554)
-s force to get signal from the DVB hardware every 200ms (use with care, only when needed)
-a x:y:z simulate x DVB-S2, y DVB-T2 and z DVB-C adapters on this box (0 means autodetect)
-m xx: simulate xx as local mac address, generates UUID based on mac
-e list_of_enabled adapters: enable only specified adapters, example 0-2,5,7 (no spaces between parameters)
-c X: bandwidth capping for the output to the network (default: unlimited)
-b X: set the DVR buffer to X KB (default: XX KB)
-l increases the verbosity (you can use multiple -l), logging to stdout in foreground mode or in /tmp/log when a daemon
-p url: specify playlist url using X_SATIPM3U header
-u unicable_string: defines the unicable adapters (A) and their slot (S), frequency (F) and optionally the PIN for the switch:\n\
The format is: A1:S1-F1[-PIN][,A2:S2-F2[-PIN][,...]] example: 2:0-1284[-1111]
-j jess_string: same format as unicable_string
-g use syslog instead stdout for logging, multiple -g - print to stderr as well\n\
-o host:port: specify the hostname and port for the dvbapi server (oscam)
-s DELSYS:host:port - specify the remote satip host and port with delivery system DELSYS: example: dvbs2:192.168.9.9[:554]
-t clean the PSI from all CA information, the client will see the channel as clear if decrypted successfully

Example of Usage:

minisatip

- Will act as a daemon and listen for connections on port 1900 (udp), 554 (rtsp) and 8080 (http) and will be able to serve satip clients connected to the LAN
minisatip -r xx.xx.xx.xx
- Forces to send the rtp packets to xx.xx.xx.xx instead of the IP that the connection comes from
- Connect to oscam using the dvbapi protocol
minisatip -o 192.168.9.9:9000
Examples:
- In order to listen to a radio on Hotbird 13E, after minisatip is started open the following URL in your favourite media player:

"http://MINISATIP_HOST:8080/?msys=dvbs&freq=11623&pol=v&sr=27500&pids=0,10750,254"
msys can be one of: dvbs, dvbs2, dvbt, dvbt2, dvbc, dvbc2, atsc, dvbcb ( - DVBC_ANNEX_B )


+ 0
- 2122
m/minisatip-0.5.69-476-gbd493b1/debian/changelog
File diff suppressed because it is too large
View File


+ 0
- 1
m/minisatip-0.5.69-476-gbd493b1/debian/compat View File

@@ -1 +0,0 @@
7

+ 0
- 13
m/minisatip-0.5.69-476-gbd493b1/debian/control View File

@@ -1,13 +0,0 @@
Source: minisatip
Section: video
Priority: extra
Maintainer: Frodo <[email protected]>
Build-Depends: debhelper (>= 9), libdvbcsa-dev, libssl-dev, libxml2-dev, libmcli-dev
Standards-Version: 3.9.5
Homepage: https://code.google.com/p/satip/

Package: minisatip
Architecture: any
Depends: ${misc:Depends}, libdvbcsa1, libssl1.0.0, libxml2, libmcli
Description: minisatip single threaded satip server


+ 0
- 36
m/minisatip-0.5.69-476-gbd493b1/debian/copyright View File

@@ -1,36 +0,0 @@
Upstream Homepage:
git clone https://github.com/catalinii/minisatip.git

Upstream Author:
catalinii

Debian Maintainer(s):
Frodo <frodo-vdr (at) gmx (dot) net>

Copyright:
(C) 2015 catalinii

Copyright (Debian packaging):
(C) 2015 Frodo

License:
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.

The complete text of the GNU General Public License can be found
in /usr/share/common-licenses/GPL-2 on most Debian systems.

License (Debian packaging):
The Debian packaging is licensed under the GPL, version 2 or any
later version, see /usr/share/common-licenses/GPL-2.

+ 0
- 103
m/minisatip-0.5.69-476-gbd493b1/debian/default/minisatip View File

@@ -1,103 +0,0 @@
#
# minisatip options
#
# minisatip [-[fgltz]] [-a x:y:z] [-b X:Y] [-c X] [-d A:C-U ] [-D device_id] [-e X-Y,Z] [-i prio] [-j A1:S1-F1[-PIN]] [-m mac] [-o oscam_host:dvbapi_port] [-p public_host] [-r remote_rtp_host] [-R document_root] [-s [DELSYS:]host[:port] [-u A1:S1-F1[-PIN]] [-w http_server[:port]] [-x http_port] [-X xml_path] [-y rtsp_port]
#
#
# -a x:y:z simulate x DVB-S2, y DVB-T2 and z DVB-C adapters on this box (0 means auto-detect)
# eg: -a 1:2:3
# - it will report 1 dvb-s2 device, 2 dvb-t2 devices and 3 dvb-c devices
#
# -b --buffers X:Y : set the app adapter buffer to X Bytes (default: 25004) and set the kernel DVB buffer to Y Bytes (default: 5775360) - both multiple of 188
# eg: -b 18800:18988
#
# -c X: bandwidth capping for the output to the network [default: unlimited]
# eg: -c 2048 (does not allow minisatip to send more than 2048KB/s to all remote servers)
#
# -d --diseqc ADAPTER1:COMMITED1-UNCOMMITED1[,ADAPTER2:COMMITED2-UNCOMMITED2[,...]
# The first argument is the adapter number, second is the number of commited packets to send to a Diseqc 1.0 switch, third the number of uncommited commands to sent to a Diseqc 1.1 switch
# The higher number between the commited and uncommited will be sent first.
# eg: -d 0:1-0 (which is the default for each adapter).
#
# -D --device-id DVC_ID: specify the device id (in case there are multiple SAT>IP servers in the network)
# eg: -D 4
#
# -e --enable-adapters list_of_enabled adapters: enable only specified adapters
# eg: -e 0-2,5,7 (no spaces between parameters)
# - keep in mind that the first adapters are the local ones starting with 0 after that are the satip adapters
# if you have 3 local dvb cards 0-2 will be the local adapters, 3,4, ... will be the satip servers specified with argument -s
#
# -f foreground, otherwise run in background
#
# -g use syslog instead stdout for logging, multiple -g - print to stderr as well
#
# -i --priority prio: set the process priority to prio (-10 increases the priority by 10)
#
# -l increases the verbosity (you can use multiple -l), logging to stdout in foreground mode or in /tmp/log when a daemon
# eg: -l -l -l
#
# -m xx: simulate xx as local mac address, generates UUID based on mac
# -m 001122334455
#
# -o --dvbapi host:port - specify the hostname and port for the dvbapi server (oscam)
# eg: -o 192.168.9.9:9000
# 192.168.9.9 is the host where oscam is running and 9000 is the port configured in dvbapi section in oscam.conf
#
# -p url: specify playlist url using X_SATIPM3U header
# eg: -p http://192.168.2.3:8080/playlist
# - this will add X_SATIPM3U tag into the satip description xml
#
# -r --remote-rtp remote_rtp_host: send the rtp stream to remote_rtp_host instead of the ip the connection comes from
# eg: -r 192.168.7.9
#
# -R --document-root directory: document root for the minisatip web page and images
#
# -s --satip-servers DELSYS:host:port - specify the remote satip host and port with delivery system DELSYS, it is possible to use multiple -s
# DELSYS - can be one of: dvbs, dvbs2, dvbt, dvbt2, dvbc, dvbc2, isdbt, atsc, dvbcb ( - DVBC_ANNEX_B ) [default: dvbs2]
# host - the server of the satip server
# port - rtsp port for the satip server [default: 554]
# eg: -s 192.168.1.2 -s dvbt:192.168.1.3:554 -s dvbc:192.168.1.4
# - specifies 1 dvbs2 (and dvbs)satip server with address 192.168.1.2:554
# - specifies 1 dvbt satip server with address 192.168.1.3:554
# - specifies 1 dvbc satip server with address 192.168.1.4:554
#
# -S --slave ADAPTER1,ADAPTER2-ADAPTER4[,..] - specify slave adapters
# Allows specifying bonded adapters (multiple adapters connected with a splitter to the same LNB)
# Only one adapter needs to be master all others needs to have this parameter specified
# eg: -S 1-2
# - specifies adapter 1 to 2 as slave, in this case adapter 0 can be the master that controls the LNB
#
# -t --cleanpsi clean the PSI from all CA information, the client will see the channel as clear if decrypted successfully
#
# -T --threads: enables/disable multiple threads (reduces memory consumptions) (default: ENABLED)
#
# -u --unicable unicable_string: defines the unicable adapters (A) and their slot (S), frequency (F) and optionally the PIN for the switch:
# The format is: A1:S1-F1[-PIN][,A2:S2-F2[-PIN][,...]]
# eg: 2:0-1284[-1111]
#
# -j --jess jess_string - same format as -u
#
# -w --http-host http_server[:port]: specify the host and the port (if not 80) where the xml file can be downloaded from [default: default_local_ip_address:8080]
# eg: -w 192.168.1.1:8080
#
# -x --http-port port: port for listening on http [default: 8080]
# eg: -x 9090
#
# -X --xml PATH: the path to the xml that is provided as part of the satip protocol
# by default desc.xml is provided by minisatip without needing an additional file,
# however satip.xml is included if it needs to be customized
#
# -y --rtsp-port rtsp_port: port for listening for rtsp requests [default: 554]
# eg: -y 5544
# - changing this to a port > 1024 removes the requirement for minisatip to run as root
#
# -z --check-signal force to get signal from the DVB hardware every 200ms (use with care, only when needed)
# - retrieving signal could take sometimes more than 200ms which could impact the rtp stream, using it only when you need to adjust your dish
#
# Example:
# OPTIONS="-a 0:0:0 -s [IP-OctopusNet] -s [IP-DigibitR1] -x 9090 -o [IP-Oscam]:[Port DVBAPI Oscam]"
OPTIONS="-x 9090"

# remove comment to start minisatip
START=yes


+ 0
- 1
m/minisatip-0.5.69-476-gbd493b1/debian/docs View File

@@ -1 +0,0 @@
README.md

+ 0
- 57
m/minisatip-0.5.69-476-gbd493b1/debian/get-new-snapshot.sh View File

@@ -1,57 +0,0 @@
#!/bin/bash
# set -x

DISTRIBUTION=trusty
GITSOURCE='https://github.com/catalinii/minisatip.git'
BUILDPREFIX=frodo
FORCEVERSION=''

DEB_SOURCE_PACKAGE=$(egrep '^Source: ' debian/control | cut -f 2 -d ' ')

PKGVERSION=`dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-.*/\1/p'`
SUBVERSION=$(dpkg-parsechangelog | grep ^Version: | sed -e 's/^Version:\s*//' -e 's/~.*//g' | awk -F'-' '{ print $4 }' | sed -e "s/${BUILDPREFIX}.*//g")

git pull origin
CHANGES=$(git log --pretty=format:"%h: %s" -1)

GIT_SHA=$(git show --pretty=format:"%h" --quiet | head -1 || true)
# UPSTREAMVERSION="$(git describe)"
UPSTREAMVERSION="$(git describe --tags 2> /dev/null)"
if [ $? -ne 0 ] ; then
VERSION_BUILD=$(grep '#define VERSION_BUILD' minisatip.h | sed -e 's/^.*=//g' -e 's/[";]//g' | awk {' print $3 '})
VERSION_MAIN=$(grep '#define VERSION CC' minisatip.h | awk -F'(' '{print $2}' | awk -F',' '{print $1}')
SOURCEVERSION=${VERSION_MAIN}${VERSION_BUILD}
GITHEAD=`git rev-list HEAD | wc -l`
UPSTREAMVERSION="${SOURCEVERSION}-${GITHEAD}-g${GIT_SHA}"
fi



test=$(grep ${GIT_SHA} debian/changelog)
if [ $? -eq 0 ] ; then
SUBVERSION=$((SUBVERSION +1))
else
SUBVERSION=0
fi

NEWVERSION=${UPSTREAMVERSION}-${SUBVERSION}${BUILDPREFIX}0~${DISTRIBUTION}

if [ ! -f ../${DEB_SOURCE_PACKAGE}_${VERSION_FULL}.orig.tar.xz ] ; then
test=$(git config -l | grep xz)
if [ $? -ne 0 ] ; then
git config tar.tar.xz.command "xz -c"
fi
git archive --format=tar.xz --prefix=${DEB_SOURCE_PACKAGE}-${UPSTREAMVERSION}/ --output=../${DEB_SOURCE_PACKAGE}_${UPSTREAMVERSION}.orig.tar.xz origin/master
fi
dch -v ${FORCEVERSION}${NEWVERSION} -u medium -D ${DISTRIBUTION} --force-distribution "new upstream snapshot"
[ $? -ne 0 ] && exit 1
while read -r line ; do dch -a "${line}" ; done <<< "${CHANGES}"
debuild -S -sa

OTHERDISTRIBUTION=xenial
OTHERVERSION=${UPSTREAMVERSION}-${SUBVERSION}${BUILDPREFIX}0~${OTHERDISTRIBUTION}
dch -v ${FORCEVERSION}${OTHERVERSION} --force-bad-version -u medium -D ${OTHERDISTRIBUTION} --force-distribution "rebuild for ${OTHERDISTRIBUTION}"
while read -r line ; do dch -a "${line}" ; done <<< "${CHANGES}"
debuild -S -sa

exit 0

+ 0
- 3
m/minisatip-0.5.69-476-gbd493b1/debian/install View File

@@ -1,3 +0,0 @@
minisatip usr/bin
debian/default/minisatip etc/default
html/* var/lib/minisatip

+ 0
- 79
m/minisatip-0.5.69-476-gbd493b1/debian/minisatip.init View File

@@ -1,79 +0,0 @@
#!/bin/sh
# Start/stop the minisatip daemon
#
### BEGIN INIT INFO
# Provides: minisatip
# Required-Start: $syslog $network $pcscd
# Required-Stop: $syslog $network $pcscd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and Stop minisatip
# Description: minisatip init script. This script start and stop minisatip
### END INIT INFO

. /lib/lsb/init-functions

DESC="minisatip Server"
BINARY=minisatip
DAEMON=/usr/bin/$BINARY
PIDFILE=/var/run/minisatip.pid
LOG=/var/log/minisatip.log
CONFIG=/etc/default/minisatip
START="$DAEMON -- --document-root /var/lib/minisatip $OPTIONS"

#test -f $DAEMON || exit 0
[ -x $DAEMON ] || exit 1
[ -f $CONFIG ] || exit 1

. $CONFIG

if [ -z "$START" ]; then
echo "Start was disabled in $CONFIG"
exit 1
fi


START="$DAEMON -- $OPTIONS"

clear_file() {
# Clear log and pid file if exists
if [ -e $PIDFILE ]; then
rm -f $PIDFILE
fi

if [ -e $LOG ]; then
rm -f $LOG
fi
}

case "$1" in
start)
clear_file
log_daemon_msg "Starting $DESC"
start-stop-daemon --start --quiet --exe $DAEMON --startas $START
pidof $BINARY > $PIDFILE
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC"
start-stop-daemon --stop --quiet --exe $DAEMON
log_end_msg $?
;;
restart)
log_daemon_msg "Restarting $DESC"
start-stop-daemon --stop --retry 5 --quiet --exe $DAEMON
clear_file
start-stop-daemon --start --quiet --exe $DAEMON --startas $START
pidof $BINARY > $PIDFILE
log_end_msg $?
;;
status)
status_of_proc -p $PIDFILE $DAEMON $BINARY && exit 0 || exit $?
;;
*)
log_action_msg "Usage: /etc/init.d/${BINARY} {start|stop|restart|status}"
exit 2
;;
esac

exit 0

+ 0
- 44
m/minisatip-0.5.69-476-gbd493b1/debian/minisatip.upstart View File

@@ -1,44 +0,0 @@
# minisatip - satip server
#

description "minisatip server"

start on local-filesystems and net-device-up IFACE!=lo
stop on runlevel [!2345]

emits minisatip-started
emits minisatip-stopped

console log

respawn
respawn limit 5 60

pre-start script
if [ -f /etc/default/minisatip ] ; then
. /etc/default/minisatip
fi
if [ "$START" != 'yes' ] ; then
echo "minisatip is disabled in /etc/default/minisatip"
exit 1
fi

if [ ! -x /usr/bin/minisatip ] ; then
exit 1
fi

end script

script
. /etc/default/minisatip
exec /usr/bin/minisatip -f --document-root /var/lib/minisatip $OPTIONS
end script

post-start script
initctl emit --no-wait minisatip-started
end script

post-stop script
initctl emit --no-wait minisatip-stopped
end script


+ 0
- 16
m/minisatip-0.5.69-476-gbd493b1/debian/rules View File

@@ -1,16 +0,0 @@
#!/usr/bin/make -f


#export DH_VERBOSE=1
%:
dh [email protected]

override_dh_auto_configure:
dh_auto_configure -- --with-mcli=/usr/include/libmcli

override_dh_installinit:
dh_installinit --name=minisatip --no-start

override_dh_auto_clean:
@-rm -f *.o minisatip config.log config.status Makefile


+ 0
- 1
m/minisatip-0.5.69-476-gbd493b1/debian/source/format View File

@@ -1 +0,0 @@
3.0 (quilt)

+ 0
- 1145
m/minisatip-0.5.69-476-gbd493b1/dvb.c
File diff suppressed because it is too large
View File


+ 0
- 245
m/minisatip-0.5.69-476-gbd493b1/dvb.h View File

@@ -1,245 +0,0 @@
#ifndef DVB_H
#define DVB_H

#ifdef DISABLE_LINUXDVB
//#include <linux/types.h>
#include <stdint.h>
#include <time.h>
#define DVBAPIVERSION 0x0500
#define LOGDVBAPIVERSION 0x0000
#endif

#ifndef DISABLE_LINUXDVB
#include <linux/dvb/frontend.h>
#include <linux/dvb/dmx.h>
#include <linux/dvb/ca.h>
#include <linux/dvb/version.h>
#define DVBAPIVERSION (DVB_API_VERSION << 8 | DVB_API_VERSION_MINOR)
#define LOGDVBAPIVERSION DVBAPIVERSION
#endif

#if DVBAPIVERSION < 0x0500
#error minisatip requires Linux DVB driver API version 5.0 or higher!
#endif


#ifdef DISABLE_LINUXDVB
typedef enum fe_delivery_system {
SYS_UNDEFINED,
SYS_DVBC_ANNEX_AC,
SYS_DVBC_ANNEX_B,
SYS_DVBT,
SYS_DSS,
SYS_DVBS,
SYS_DVBS2,
SYS_DVBH,
SYS_ISDBT,
SYS_ISDBS,
SYS_ISDBC,
SYS_ATSC,
SYS_ATSCMH,
SYS_DMBTH,
SYS_CMMB,
SYS_DAB,
SYS_DVBT2,
SYS_TURBO,
} fe_delivery_system_t;
typedef enum fe_status {
FE_HAS_SIGNAL = 0x01,
FE_HAS_CARRIER = 0x02,
FE_HAS_VITERBI = 0x04,
FE_HAS_SYNC = 0x08,
FE_HAS_LOCK = 0x10,
FE_TIMEDOUT = 0x20,
FE_REINIT = 0x40
} fe_status_t;
typedef enum fe_code_rate {
FEC_NONE = 0,
FEC_1_2,
FEC_2_3,
FEC_3_4,
FEC_4_5,
FEC_5_6,
FEC_6_7,
FEC_7_8,
FEC_8_9,
FEC_AUTO,
FEC_3_5,
FEC_9_10,