Project

General

Profile

Feature #4620

SAT>IP: Replace "pids=all" requests

Added by Mono Polimorph about 7 years ago. Updated about 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
SAT>IP
Target version:
-
Start date:
2017-09-22
Due date:
% Done:

100%

Estimated time:

Description

Hi,

Another patch to improve compatibility!

In some circumstances you don't like to support the Full Transport Stream. I mean, you like to 'block' any "pids=all" request. Some scenarios where this would be wished for could be:

  • Using a Stream Analyzer when your tuner can't provide the full TS.
  • With bogus clients who perform the scaning process by requesting the entire TS.
  • When you want to 'protect' your wireless clients from heavy TS (>40Mbps).
  • etc.

In these circunstances this patch helps. It adds the option to replace the "pids=all" parameter with a the list of pids [0-20]. Look at the patch:

diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c
index e194bcc..04832e8 100644
--- a/src/satip/rtsp.c
+++ b/src/satip/rtsp.c
@@ -857,7 +857,14 @@ parse_pids(char *p, mpegts_apids_t *pids)
     if (x == NULL)
       break;
     if (strcmp(x, "all") == 0) {
-      pids->all = 1;
+      if (satip_server_conf.satip_replace_pids_all) {
+        pids->all = 0;
+        for (pid = 1; pid <= 20; pid++) {
+           mpegts_pid_add(pids, pid, MPS_WEIGHT_RAW);
+        }
+      } else {
+        pids->all = 1;
+      }
     } else {
       pids->all = 0;
       pid = atoi(x);
diff --git a/src/satip/server.c b/src/satip/server.c
index e6b5fdf..67ed976 100644
--- a/src/satip/server.c
+++ b/src/satip/server.c
@@ -678,6 +678,16 @@ const idclass_t satip_server_class = {
       .group  = 1,
     },
     {
+      .type   = PT_BOOL,
+      .id     = "satip_replace_pids_all",
+      .name   = N_("Disable \"pids=all\""),
+      .desc   = N_("Replace the Full Transport Stream with a range " 
+                   "0x00-0x16 pids only."),
+      .off    = offsetof(struct satip_server_conf, satip_replace_pids_all),
+      .opts   = PO_EXPERT,
+      .group  = 1,
+    },
+    {
       .type   = PT_INT,
       .id     = "satip_weight",
       .name   = N_("Subscription weight"),
diff --git a/src/satip/server.h b/src/satip/server.h
index 054e481..4171ff5 100644
--- a/src/satip/server.h
+++ b/src/satip/server.h
@@ -51,6 +51,7 @@ struct satip_server_conf {
   int satip_notcp_mode;
   int satip_anonymize;
   int satip_noupnp;
+  int satip_replace_pids_all;
   int satip_iptv_sig_level;
   int satip_force_sig_level;
   int satip_dvbs;

An upgrade to this enhancement may be to provide to the user the option for selecting the list of pids to replace. However, this is a second step.
Please if you agree commit this patch as well.
Thank you!


Files

SAT-IP-Disable-pids-all.diff (1.59 KB) SAT-IP-Disable-pids-all.diff Patch Mono Polimorph, 2017-09-22 19:10

History

#1

Updated by Mono Polimorph about 7 years ago

Hi,

And this my last patch at the moment. This improves the security and solves some specific cases. Please, consider also committing it.

Thank you!

#2

Updated by Mono Polimorph about 7 years ago

Still waiting for the acceptance of this patch. ;)

#3

Updated by Mono Polimorph about 7 years ago

I hope this patch will be accepted.
If there is something to change, please tell me what I have to do. ;)

#4

Updated by Jaroslav Kysela about 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|693c03b291a96dd5332e8ef778e1eb63dc7e2007.

#5

Updated by Mono Polimorph about 7 years ago

Thank you! ;) (/)

Also available in: Atom PDF