Multi CardServer r80
Download
View r63 source code

History log
 - r80
* added option to check for via. ecm
* added option to enable/disable cache filter.
* added filter to check for incoming cw from servers/cache with previous stored cws.
* extended CACHE AUTOADD to enable/disable cache peers upon adding them.
* restructured cache database for memory/cpu optimizations.
* new http option to download/show in browser some files from your server.
 - r79
* reduced ram consumption.
* fixed huge cpu usage (removed multithreaded part)
* fixed cahceex and freecccam code
 - r78
* removed cccam cacheex (tcp connection overload server)
* optimized clients username search
* fixed cache webpage
* optimized functions call
* added telnet server
* added multiple cache servers management
* moved from mono thread to multithreaded servers
* added cache filter
* added new constant in sidlist to filter bad codes (like in twin2cs)
GENERAL OPTIONS (multics.cfg)
FILE CHANNELINFO: <filename>
setup channelinfo file name and path (default is disabled)
FILE CHANNELINFO: "/var/etc/CCcam.channelinfo"
FILE PROVIDERINFO: <filename>
set providers info file name and path (default is disabled)
This file contains all provider idents that are used in the web interface
FILE PROVIDERINFO: "/var/etc/CCcam.providers"
FILE IP2COUNTRY: <filename>
Set ip2country database file name and path. (default is disabled)
FILE IP2COUNTRY: "/var/etc/ip2country.csv"
FILE STYLESHEET: <filename>
Set stylesheet file name and path for the web interface. (default is the built-in stylesheet file)
FILE STYLESHEET: "/var/etc/multics.css"
INCLUDE: <filename>
add new file to be read
INCLUDE: "/var/etc/profiles"
BLOCK COUNTRY: <country code list>
Block clients connecting from the selected countries ( file ip2country must exist to enable this option )
BLOCK COUNTRY: TN # Block all clients connecting from Tunisia
BLOCK COUNTRY: FR,DE # Block all clients connecting from France or Germany
BAD-DCW: <Control word>
List of bad control word to discard when encountred
BAD-DCW: FD FF FF FB FD FF FF FB FD FF FF FB FD FF FF FB
BAD-DCW: 00 01 02 03 00 01 02 03 00 01 02 03 00 01 02 03
HTTP SERVER
HTTP PORT: <port value>
Listening port for HTTP server. default: 5500 (0=disabled)
HTTP PORT: 12345
HTTP TITLE: <title>
change web page title
HTTP TITLE: "my server"
HTTP USER: <username>
Basic authentification Username for the HTTP server
HTTP USER: admin
HTTP PASS: <password>
Basic authentification Password for the HTTP server
HTTP PASS: admin
HTTP FILE: "<file_path>", "</url>" [ , "<mime_type>" ]
download/show filepath in your browser by entring the url:  http://your_server_hostname/url
HTTP FILE: "/var/tmp/multics.log", "/log", "text/plain"
	# show log file in your browser, mime is specified as the file doesnt have a known extention
HTTP FILE: "/var/etc/compressed.rar", "/download.rar"
	# download file "/var/etc/compressed.rar" from your browser as "download.rar"
HTTP FILE: "/var/www/mypage.html", "/mypage.html"
	# show the page "/var/www/mypage.html"
HTTP EDITOR: <ON/1/OFF/0>
Flag to Show editor button/page in web interface (default is ON)
HTTP EDITOR: OFF # disable editor
HTTP EDITOR: 0 # disable editor
HTTP EDITOR: ON # show editor
HTTP EDITOR: 1 # show editor
HTTP RESTART: <ON/1/OFF/0>
Show restart button/page in web interface (default is ON)
HTTP RESTART: OFF # disable restart from web interface
HTTP AUTOREFRESH: <refresh value>
Web Page refresh time in milliseconds (default: 10000 ~ 10s)
HTTP AUTOREFRESH: 5000
CLUSTERED CACHE (CSP cache)
CACHE PORT: <value>
Cache listening port (UDP), (default:0 disabled)
CACHE PORT: 10000 # Server 1
CACHE PEER: host.com 8964

CACHE PORT: 20000 # Server 2
CACHE PEER: host2.com 7895
CACHE FILTER: <YES/NO>
filter all incoming cache/cacheex data
CACHE FILTER: YES
CACHE AUTOADD: <YES/NO> [ , <YES/NO> ]
accept/block unknown peers
CACHE AUTOADD: NO # block all unknown peers
CACHE AUTOADD: YES, YES # add all unknown peers and set their status to active (enabled)
CACHE AUTOADD: YES, NO  # add all unknown peers and set their status to inactive (disabled)
CACHE ALIVETIME: <value>
interval in which cache data are treated
CACHE ALIVETIME: 35
ACCEPT NULL ONID: <ON/OFF>
accept/block cache requests with networkid=0 (default is ON)
ACCEPT NULL ONID: OFF # block packet with unknown onid
CACHE PEER: <peer host> <peer port> <0/1> { <options> }
friend cacheline (host port)
CACHE PEER: myfriend.dns.org 12345 # connect to peer only if its version is greater than r66
CACHE PEER: localhost 5555 1 # block receiving/sending cache requests with networkid=0
CACHE PEER: localhost 4444 { csp=yes } # connect to peer using default cache protocol (csp/oscam)  
CCCAM SERVER/CLIENT
CCCAM VERSION: <2.0.11/2.1.1/2.1.2/2.1.3>
Select CCcam Client/Server version (default: 2.0.11)
CCCAM VERSION: 2.1.1
CCCAM NODEID: <16 hexadecimal numbers>
Set nodeid for CCcam Client/Servers
CCCAM NODEID: 1122334455667788
CCCAM PROFILES: <newcamd port list>
set default profiles for CCcam Server to share with clients (profiles are identified by their newcamd port)
CCCAM PROFILES: 5501, 5502
CCCAM PORT: <port value>
CCcam server listen port
CCCAM PORT: 18000
CCCAM DCW CHECK: <YES/NO>
enable/disable dcwcheck for cccam clients
CCCAM DCW CHECK: YES
F: <username> <password> <reashre> { <options> }
define cccam client to the current cccam server
## Reshares(DownHops)
F: user1 pass1  # share all profiles with no reshare
F: user2 pass2 1 # share all profiles with 1 reshare
F: user3 pass3 2 # share all profiles with 2 reshare

## Option: Profiles ( Option list can be separated by comma or by space, options are separated only by ';' )
F: user4 pass4 { profiles=5502,5504,5510 } # share only 3 profiles identified by their ports as locals with no reshare
F: user5 pass5 1 { profiles=5502 5504 5510 } # share only 3 profiles identified by their ports with 1 reshare

## Option: Name
F: user7 pass7 { \
	profiles=5502,5504,5510; \ # Profiles
	name=my dreambox; \ # Full Name
 }  # share only 3 profiles identified by their ports as locals with no reshare

## Option: Host
F: user8 pass8 { \
	name = my dreambox; \ # Full Name
	host = 192.168.1.81 \ # user8 is only allowed to connect from the host 192.168.1.81
}

## Option: Shares (ShareLimtis)
F: user11 pass11 { \
	shares=0500:42800:0; \ # Send profiles to user10 but not the share (0500:042800) 
}

F: user12 pass12 { \
	shares=0:0:0,0604:0:1; \ # Send only share (0604:0) to client.
}

F: user13 pass13 { \
	shares=0100:0:0; \ # Send profiles to client but not seca shares.
}

## Option: dcwcheck
F: user13 pass13 { \
	dcwcheck=YES; \ # enable dcw check for every incoming ecm request from this client
}

##### SECOND CCCAM SERVER

CCCAM PORT: 19000

## Second CCcam Server's clients
F: user1 pass1
F: user2 pass2
CacheEX mode 3
connect to cacheex server using mode 3
C: host port cachemcs pass { cacheex_mode=3; }
FREECCCAM SERVER
FREECCCAM PORT : <port value>
FREECCCAM server listen port (default=0:disabled)
FREECCCAM PORT : 7890
FREECCCAM USERNAME: <username>
Username
FREECCCAM USERNAME:: test
FREECCCAM PASSWORD: <password>
Password
FREECCCAM PASSWORD: test
FREECCCAM MAXUSERS : <value>
Max clients to be connected to server, any other connection would be rejected or replaced by an inactive connection
FREECCCAM MAXUSERS : 100
MGCAMD SERVER
MGCAMD PORT : <port value>
MGCAMD server listen port(default=0:disabled)
MGCAMD PORT : 23000
MGCAMD KEY : <des key>
Change mgcamd des key ( default = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 )
MGCAMD KEY : 81 82 83 84 85 86 87 88 89 80 81 82 83 84
MGCAMD PROFILES: 5501, 5503, 5504 # default profiles available for mgcamd clients.

MGCAMD PROFILES: 5501, 5503, 5504 # default profiles available for mgcamd clients.
MGCAMD DCW CHECK: <YES/NO>
enable/disable dcwcheck for mgcamd clients
MGCAMD DCW CHECK: YES
MGUSER: <username> <password> { <options> }
Define new client for the current mgcamd server
# Clients
MGUSER: user1 pass1 # send cards of all profiles

## Option: Profiles ( Option list can be separated by comma or by space, options are separated only by ';' )
MG: user3 pass3 { profiles=5504, 5510 } # send cards of 2 selected profiles

## Option: Name
MG: user5 pass5 { \
	profiles=5502,5504,5510; \ # Profiles
	name=my dreambox; \ # Full Name
 }  # share only 3 profiles identified by their newcamd ports

## Option: Host
MG: user6 pass6 { \
	name = my dreambox; \ # Full Name
	host = 192.168.1.81 \ # user8 is only allowed to connect from the host 192.168.1.81
}

## Option: Shares (ShareLimtis)
MG: user9 pass9 { \
	shares=0100:3315:0; \ # Send profiles to client but not the share (0100:3315) 
}

MG: user10 pass10 { \
	shares=0:0:0,09CD:0:1; \ # Send only share (09CD:0) to client.
}

MG: user11 pass11 { \
	shares=0500:0:0; \ # Send profiles to client but not viaccess shares.
}

## Option: dcwcheck
MG: user22 pass22 { \
	dcwcheck=YES; \ # enable dcw check for every incoming ecm request from this client
}
SERVERS CONNECTIONS
C: <hostname/ip> <port> <username> <password> < { <options> } >
Connection to CCcam Server
C: host.dnsdynamic.com \ # Server Hostname
	12345 \ # CCcam Server Port
	user \  # Username
	pass    # Password
 # get all shares from server with reshare or not.

## OPTION 'profiles'
C: host.dnsdynamic.com 12345 user1 pass1 { profiles=5501,5502,5503 }
 # use this server only for profiles with newcamd ports (5501,5502,5503)

## OPTION 'shares'
C: host.dnsdynamic.com 12345 user2 pass2 { shares= 0:0:2 }
 # ignore shares more than 2 uphops away (0:0:2)

C: host.dnsdynamic.com 12345 user3 pass3 { shares= 0:0:3, 0100:3311:1 }
 # ignore shares more than 3 uphops away (0:0:3) and accept share 0100:3311 only from their locals

C: host.dnsdynamic.com 12345 user4 pass4 { shares= 0:0:0, 0500:32830:2 }
 # ignore all shares (0:0:0) but accept share 0500:32830 less than 2 uphops away

## OPTION 'sids'
C: host.dnsdynamic.com 12345 user5 pass5 { shares=0:0:0,0500:23800:1; sids=0385,038B,038F,03DE,36B2,36B3,36B8,36B9 }
 # accept only locals for share(0500:23800) and send ecm request only for channels specified in sid list
N: <hostname/ip> <port> <username> <password> <des key> < { <options> } >
Connection to Newcamd/Mgcamd Server
N: localhost \ # Host
   4444 \ # Port
   user \ # Username
   pass \ # Password
   01 02 03 04 05 06 07 08 09 10 11 12 13 14 # DES key

## OPTION 'profiles'
N: host.dnsdynamic.com 12346 user1 pass1 01 02 03 04 05 06 07 08 09 10 11 12 13 14 { profiles=5501,5502,5503 }
 # use this server only for profiles with newcamd ports (5501,5502,5503)

## OPTION 'shares'
N: host.dnsdynamic.com 12346  user3 pass3 01 02 03 04 05 06 07 08 09 10 11 12 13 14 { shares= 0:0:1, 0100:3311:0 }
 # accept shares but ignore share(0100:3311)

N: host.dnsdynamic.com 12346 user4 pass4 01 02 03 04 05 06 07 08 09 10 11 12 13 14  { shares= 0:0:0, 0500:32830:1 }
 # ignore all shares (0:0:0) but accept share(0500:32830)

## OPTION 'sids'
N: host.dnsdynamic.com 12346 user5 pass5 01 02 03 04 05 06 07 08 09 10 11 12 13 14 \
  { shares=0:0:0,0500:23800:1; sids=0385,038B,038F,03DE,36B2,36B3,36B8,36B9,4331,4332,4333,4334 }
 # accept only locals

## Multiple port in one line
N: host.dnsdynamic.com 14000:14030 user pass 01 02 03 04 05 06 07 08 09 10 11 12 13 14
 # connect to servers with ports from 14000 to 14030

N: host.dnsdynamic.com 14000,14005:14007,14017,14021:14023 user pass 01 02 03 04 05 06 07 08 09 10 11 12 13 14
 # Connect to servers having the next ports: 14000, 14005,14006,14007, 14017, 14021, 14022, 14023
R: <hostname/ip> <port> <caid> <provider list>
Connection to Radegast Server
R: localhost 5421 0100 3311 3315
PROFILES: DEFAULT OPTIONS
DEFAULT KEY: <des_key>
change newcamd des key (default = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 ) 
DEFAULT KEY: 11 12 13 14 05 06 07 08 09 10 01 02 03 04
DEFAULT DCW TIMEOUT: <value>
delay after that if no cw returned from servers, multics would send decode failed to client
DEFAULT DCW TIMEOUT: 3500
DEFAULT DCW MAXFAILED: <value>
Default, maximum of successive decode failed returned from a card on a channel to block sending ecm requests to this card
DEFAULT DCW MAXFAILED: 10
DEFAULT DCW CHECK: <YES/NO>
Check and filter wrong dcw for this profile if the client sending request has dcwcheck enabled (default=0)
DEFAULT DCW CHECK: YES
DEFAULT SERVER MAX: <value>
(dont use) max server to use for decoding one ecm request. (default=0,unlimited) 
DEFAULT SERVER MAX: 0
DEFAULT SERVER FIRST: <value>
the number of servers to send ecm upon receiving request (default=0, one server)
DEFAULT SERVER FIRST: 0
DEFAULT SERVER INTERVAL: <value>
Interval between sending ecm request to servers.
first server will be requested at receiving ecm request from client,
the second request will be done after "SERVER INTERVAL" has been elapsed and so ...
DEFAULT SERVER INTERVAL: 700
DEFAULT SERVER TIMEOUT: <value>
max time for selecting servers to decode one ecm request it must be greater than "SERVER INTERVAL"
DEFAULT SERVER TIMEOUT: 3000
DEFAULT SERVER VALIDECMTIME: <value>
Disable sending ecmrequest to cards with ecmtime greater than 2000ms (default=0,all card are accepted)
DEFAULT SERVER VALIDECMTIME: 2000
DEFAULT RETRY NEWCAMD: <value>
Number of retries for newcamd servers (default=0(no retry);max=3)
DEFAULT RETRY NEWCAMD: 0
DEFAULT RETRY CCCAM: <value>
Number of retries for CCcam servers if we got decode failed(default=0;max=10)
DEFAULT RETRY CCCAM: 0
DEFAULT CACHE TIMEOUT: <value>
maximum time to wait cw from cache after that ecm will be sent to servers
DEFAULT CACHE TIMEOUT: 300
DEFAULT DISABLE CCCAM: <YES/NO>
Enable/Disable sending ecm requests to CCcam servers (default=NO,enabled)
DEFAULT DISABLE CCCAM: YES # same as 'DEFAULT ENABLE CCCAM: NO' (by default CCcam servers are enabled)
DEFAULT DISABLE NEWCAMD: <YES/NO>
Enable/Disable sending ecm requests to newcamd servers (default=NO,enabled)
DEFAULT DISABLE NEWCAMD: YES # same as 'DEFAULT ENABLE CCCAM: NO' (by default Newcamd servers are enabled)
DEFAULT DISABLE RADEGAST: <YES/NO>
Enable/Disable sending ecm requests to radegast servers (default=NO,enabled)
DEFAULT DISABLE RADEGAST: YES # same as 'DEFAULT ENABLE RADEGAST: NO' (by default Radegast servers are enabled)
DEFAULT DISABLE CACHE: <YES/NO>
Enable/Disable sending ecm requests to cache servers (default=NO,enabled)
DEFAULT DISABLE CACHE: YES # same as 'DEFAULT ENABLE CACHE: NO' (by default Cache is enabled)
DEFAULT DISABLE CACHEEX: <YES/NO>
Enable/Disable sending ecm requests to cacheex servers (default=YES,disabled)
DEFAULT DISABLE CACHEEX: NO # same as 'DEFAULT ENABLE CACHEEX: YES'
PROFILE
[ <Profile Name> ]
Add new profile and set its name
<CanalsatHD>
CAID: <caid hex value>
Set caid value for the current profile
CAID: 0100
CAID: 0BAA
PROVIDERS: <providers_list>
Set providers list for the current profile
PROVIDERS: 42400
PROVIDERS: 3311,3315,3317
ONID: <value>
Set Operator Netword ID for the current profile
ONID: 31
SID LIST: <sid:chid:ecmlen.cw1cycle, sid:chid:ecmlen.cw1cycle, ... >
Set sid list for the current profile. All ecm requests will be filtered used this list
SID LIST: 20D2, 20D3, 20D4
SID LIST: 189D.80, 189E.80, 189F.80, 18B1.80, 18B2.80, 18B3.80
SID LIST: 02c2:00cc, 02c4:00cd, 02fe:0020, 02c5:009c
DENY SIDLIST: <YES/NO>
Reject request for channels within sidlist (default=NO=accept)
DENY SIDLIST: YES
ECM LENGTH: <list>
Filter to accept only request with ecm length found in list
ECM LENGTH: 64,47
ECM CHECK: <YES/NO>
Check for bad via. ecm (default=0)
ECM CHECK: YES
DCW CHECK: <YES/NO>
Check and filter wrong dcw for this profile if the client sending request has dcwcheck enabled (default=0)
DCW CHECK: YES
DCW TIMEOUT: <value>
delay after that if no cw returned from servers, multics would send decode failed to client
DCW TIMEOUT : 3500
DCW MAXFAILED: <value>
Maximum of successive decode failed returned from a card on a channel to block sending ecm requests to this card
DCW MAXFAILED: 10
SERVER MAX: <value>
(dont use) max server to use for decoding one ecm request. (default=0,unlimited) 
SERVER MAX: 0
SERVER FIRST: <value>
the number of servers to send ecm upon receiving request (default=0, one server)
SERVER FIRST: 2
SERVER INTERVAL: <value>
Interval between sending ecm request to servers.
first server will be requested at receiving ecm request from client,
the second request will be done after "SERVER INTERVAL" has been elapsed and so ...
SERVER INTERVAL: 1000 # in milliseconds
SERVER TIMEOUT: <value>
max time for selecting servers to decode one ecm request it must be greater than "SERVER INTERVAL"
SERVER TIMEOUT: 2500
SERVER VALIDECMTIME:
Disable sending ecmrequest to cards with ecmtime greater than 2000ms (default=0,all card are accepted)
SERVER VALIDECMTIME: 2000
RETRY NEWCAMD: <value>
Number of retries for newcamd servers (default=0(no retry);max=3)
RETRY NEWCAMD: 1
RETRY CCCAM: <value>
Number of retries for CCcam servers if we got decode failed(default=0;max=10)
RETRY CCCAM: 5
DISABLE NEWCAMD: <YES/NO>
Enable/Disable sending ecm requests to Newcamd servers (default=NO,enabled)
DISABLE NEWCAMD: YES
DISABLE CCCAM: <YES/NO>
Enable/Disable sending ecm requests to CCcam servers (default=NO,enabled)
DISABLE CCCAM: YES
DISABLE RADEGAST: <YES/NO>
Enable/Disable sending ecm requests to Radegast servers (default=NO,enabled)
DISABLE RADEGAST: YES
DISABLE CACHE: <YES/NO>
Enable/Disable receiving dcw from cache (default=NO,enabled)
DISABLE CACHE: YES
KEY: <des key>
change newcamd des key
KEY: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 # newcamd des key
PORT: <value>
Change newcamd listen port of the current profile (default port is 8000)
PORT: 5501
 # if port is omitted, the port value of the previous profile is taken +1
USER: <username> <password>
Define a new newcamd client
USER: user1 pass1
  # Newcamd client ( nline is like that "N: mydns.dns 5501 user1 pass1 01 02 03 04 05 06 07 08 09 10 11 12 13 14" )
USER: user2 pass2
TELNET SERVER
TELNET PORT: <value>
Change telnet listen port
default port for telnet is 0 (disabled)
TELNET PORT: 15000
TELNET USER: <username>
The telnet server is protected with a username and password
TELNET USER: admin
TELNET PASS: <password>
The telnetinfo service is protected with a username and password
TELNET PASS: admin
Supported commands

help: show commands list
uptime: show execution time
stat: show number of different servers 
cccam: display cccam servers connections status
mgcamd: display mgcamd servers connections status
debug: display latest debug lines
loadavg: display cpu load average
cpuinfo: display cpu info
meminfo: display memory info
exit: disconnect from server
quit: disconnect from server


Flag Counter