From: Jaroslav Kysela Date: Fri, 18 Mar 2016 10:22:07 +0000 (+0100) Subject: SAT>IP Client: add network_group X-Git-Tag: v4.2.1~841 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b913c6142090f271d0b1055b7f7c90d58f10a62;p=thirdparty%2Ftvheadend.git SAT>IP Client: add network_group --- diff --git a/src/input/mpegts/satip/satip_private.h b/src/input/mpegts/satip/satip_private.h index 59a6d1c62..a829f457e 100644 --- a/src/input/mpegts/satip/satip_private.h +++ b/src/input/mpegts/satip/satip_private.h @@ -184,6 +184,7 @@ struct satip_satconf int sfc_grace; char *sfc_name; int sfc_network_limit; + int sfc_network_group; /* * Assigned networks to this SAT configuration diff --git a/src/input/mpegts/satip/satip_satconf.c b/src/input/mpegts/satip/satip_satconf.c index 7fd96c9f6..d835f5a0b 100644 --- a/src/input/mpegts/satip/satip_satconf.c +++ b/src/input/mpegts/satip/satip_satconf.c @@ -75,9 +75,15 @@ satip_satconf_check_network_limit count = 0; TAILQ_FOREACH(lfe2, &lfe->sf_device->sd_frontends, sf_link) - TAILQ_FOREACH(sfc2, &lfe2->sf_satconf, sfc_link) - if (idnode_set_exists(sfc->sfc_networks, mn) && lfe2->sf_running) + TAILQ_FOREACH(sfc2, &lfe2->sf_satconf, sfc_link) { + if (!lfe2->sf_running) continue; + if (sfc->sfc_network_group > 0 && + sfc2->sfc_network_group > 0 && + sfc2->sfc_network_group == sfc->sfc_network_group) count++; + else if (idnode_set_exists(sfc2->sfc_networks, mn)) + count++; + } return count <= sfc->sfc_network_limit; } @@ -256,13 +262,21 @@ const idclass_t satip_satconf_class = .type = PT_INT, .id = "network_limit", .name = N_("Network limit per position"), - .desc = N_("A comma separated list with tuner limits per network " - "position (src=) for satellite SAT>IP tuners. " + .desc = N_("Concurrent limit per network position (src=) " + "for satellite SAT>IP tuners. " "The first limit number is for src=1 (AA), second " "for src=2 (AB) etc."), .opts = PO_EXPERT, .off = offsetof(satip_satconf_t, sfc_network_limit), }, + { + .type = PT_INT, + .id = "network_group", + .name = N_("Network group"), + .desc = N_("Define network group to limit network usage."), + .opts = PO_EXPERT, + .off = offsetof(satip_satconf_t, sfc_network_group), + }, { .type = PT_STR, .id = "networks",