- Added optional ecm unique check to ratelimiter (experimental)


git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8432 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Fix possible segfault when template is read from disk.

strstr() can segfault if the data read in the buffer is not \0
terminated. This can happend if try to read binary file.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8433 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Create and use private templates array.

This allows storing of additional information along with templates
data (which is const).

For now we store name hash but in the future the data that comes from
struct templates (in webif/pages.c) may need to be preprocessed
(uncompressed for example) and the abstraction in this commit makes
it easier to do such changes.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8434 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Remove the need to save config info in struct templates.

Configuration data for templates was introduced in commit r7221
as a way to fix ticket #2665.

Basically we kept the configuration deps in the template and when we
loaded the template from file we checked if the config items are enabled.
If they weren't we ignorred the template like it didn't exist.

But now there is a better way. If config item was disabled when the
binary was built then the template does not exist in struct templates
at all.

So we can just check if the requested template exists in struct templates,
and if it doesn't exists we just don't try to load it from file, so the
problem in ticket #2665 is still solved but we remove lots of code (one
less place place that knows about configuration items, yay!) and lower
the binary size by ~1.4k.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8435 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Simplify template loading and checking.

The subdir logic seems to complicate the code for no good reason and
as far as I can work out it does nothing. It looks like a leftover
that can be removed.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8436 4b0bc96b-bc66-0410-9d44-ebda105a78c1
Revert "webif: Simplify template loading and checking."

This reverts commit r8346. The subdir logic is used to have different
template directories for different paths comming from http request.

For more info see:
  http://www.streamboard.tv/wbb2/thread.php?threadid=37378

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8437 4b0bc96b-bc66-0410-9d44-ebda105a78c1
Revert "webif: Remove the need to save config info in struct templates."

This reverts commit r8435. There is a use case in which external
templates declare other dependencies than the built-in ones.

This also fixes a problem with picons loading.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8438 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif/dvbapi: Do not prefix log messages comming from WebIf with "dvbapi: ".

module-dvbapi.h redefines cs_log() to include "dvbapi: " prefix.

Since module-webif.c includes module-dvbapi.h all cs_log lines coming
from webif were wrongly were prefixed with "dvbapi: ".

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8439 4b0bc96b-bc66-0410-9d44-ebda105a78c1
Even if doing a fast reset the baudrate for the ATR itself is still the default one

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8440 4b0bc96b-bc66-0410-9d44-ebda105a78c1
cryptoworks/viaccess: Allow EMMs that are reassembled by the client to work.

ACamd, mgcamd and possibly other clients reassemble and filter EMMs
before sending them to OSCam. When EMM reassembly was moved on the
local reader side in r8377, EMMs were stopped from reaching the card
until they were reassembled.

But if the EMM is already reassembled then no EMM-SH packets are
comming so the reassembly never succeeded.

With this change all EMMs reach the card even if they are not
reassembled. This allows already reassembled EMMs to work and EMM
reassembly to work.

The downside is that there would be some EMM writing errors because
the reader would try to write not assembled EMMs instead of waiting
for reassembly.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8441 4b0bc96b-bc66-0410-9d44-ebda105a78c1
irdeto: Enable shared EMM filter.

See ticket #3198.

Patch by StEVE^qSR.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8442 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Optimize images.

Use pngcrush and gimp to slim down PNGs and GIFs. This saves ~1.2k
binary size with no visual changes.

{{{
 webif/images/ICARRL.gif | Bin 527 -> 476 bytes
 webif/images/ICARRR.gif | Bin 521 -> 470 bytes
 webif/images/ICDEL.png  | Bin 404 -> 286 bytes
 webif/images/ICDIS.png  | Bin 216 -> 184 bytes
 webif/images/ICEDI.png  | Bin 342 -> 256 bytes
 webif/images/ICENA.png  | Bin 251 -> 161 bytes
 webif/images/ICENT.png  | Bin 294 -> 226 bytes
 webif/images/ICHID.png  | Bin 529 -> 443 bytes
 webif/images/ICKIL.png  | Bin 558 -> 463 bytes
 webif/images/ICREF.png  | Bin 499 -> 368 bytes
 webif/images/ICRES.png  | Bin 415 -> 316 bytes
 webif/images/ICSTA.png  | Bin 387 -> 347 bytes
}}}

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8443 4b0bc96b-bc66-0410-9d44-ebda105a78c1
- Added srvidholdseconds to ratelimiter (experimental)
  a srvid will be kept in slot for additional srvidholdseconds
  if used with enabled ecmunique, the ecm in slot must be ratelimitseconds unique

  E.G. CDS NL 0100:00006A
  
  ratelimitecm = 4
  ratelimitseconds = 10
  srvidholdseconds = 5
  ecmunique = 1

  Assign 4 srvid slots
  Ecm for srvid in slot is unique for 10 seconds
  Slotted srvid will be released after 10+5 = 15 seconds of inactivity



git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8444 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Do not store images in templates array as base64.

Save a little bit of binary size.

This commit introduces no user visible changes.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8445 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Compress built-in templates.

Use the minilzo code that we already have to compress the built-in
templates. This saves ~90k binary size on 32bit defconfig. As the
tool reports:

> Compressed 148820 template bytes into 51619 bytes. 97201 saved bytes (65.31%).

The old code that works with non-compressed templates is still here,
to use it, comment `#define USE_COMPRESSION 1` in webif/pages_gen.c
and recompile.

Once we establish that template compression works fine the old
code can be removed.

This commit introduces no user visible changes.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8446 4b0bc96b-bc66-0410-9d44-ebda105a78c1
gc: Add static declarations where needed.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8447 4b0bc96b-bc66-0410-9d44-ebda105a78c1
log: Free log history on exit.

Make valgrind a little bit happier.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8448 4b0bc96b-bc66-0410-9d44-ebda105a78c1
readers: Do not leak entitlements on card change and reader freeing.

Reader entitlements are leaken when card is changed. Probably nobody
noticed because changing cards is not an event that happen often.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8449 4b0bc96b-bc66-0410-9d44-ebda105a78c1
readers: Free configured readers on exit.

Make valgrind a little bit happier.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8450 4b0bc96b-bc66-0410-9d44-ebda105a78c1
fixed emm filter in request_mode 1


git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8451 4b0bc96b-bc66-0410-9d44-ebda105a78c1