To start Mbox you need to configure mbox.cfg first.
These parameters you must set before you can start Mbox:

D: { 0 }
//D: { x }
//x=0 -> disable
//x=1 -> enable dbox2 cw writing
//x=2 -> enable STAPI for IPBOX
//x=3 -> enable STAPI for Kathrein

T: { /tmp/ }
// T option -> where to store temp files ... (share.info,debug.txt ,etc.)
// T: { folder_path_to_files, example: T: { /tmp/ } }

K: { /var/keys/ }
// K option -> where is cwshare.cfg file
// K: { folder_path_to_files, example: K: { /var/keys/ } }

P: { /tmp/pmt.tmp }
// P option -> PMT location (Dont used with linux and windows)
// you must be tuned to channel so image can generate this file
// { /tmp/pmt.tmp } for resivers and images that create this file <- use this if you can
// { 1/tmp/camd.socket } for enigma 1
// { 2/tmp/camd.socket } for enigma 2



Now for the start of Mbox you need to know where the mbox.cfg path is.
The default path for mbox.cfg is /var/keys/
For other paths you must start mbox with path as argument!!!
For some receivers like Ipbox and Kathrein there is no /var/keys/ so you must start mbox always with arguments.

Example:

without arguments
./mbox or ./var/bin/mbox

with arguments
./mbox /data/keys/mbox.cfg or ./var/bin/mbox /data/keys/mbox.cfg

To STOP Mbox you need to create mbox.kill.
Put this mbox.kill in the temp dir of Mbox. T: path (look your settings in mbox.cfg)
Example T: { /tmp/ }: touch /tmp/mbox.kill


Other parameters of mbox.cfg that are interesting:

M: { 1 }
// M option -> Mode option
// M: { x }
// x=0 -> local mode no NET
// x=1 -> NET mode
// default 0


Z: { 12 } { 127.0.0.1 8000 }
// Z option -> control sending/writing current information
// Z: { xy } { IP port }
// x=0 -> don't print time stamp (in console screen and in debug file)
// x=1 -> print time stamp ( .... )
// y=0 -> no writing/sending information to debug file/destination IP
// y=1 -> send information to destination IP but not in debug file
// y=2 -> write information to debug file but don't send to destination IP
// y=3 -> write/send information to debug file/destination IP
// IP port -> destination IP and UDP port where to send information

Only debug file: Z: { 12 } { 127.0.0.1 8000 }
only send debug to IP: Z: { 11 } { 127.0.0.1 8000 }
Both file and IP: Z: { 13 } { 127.0.0.1 8000 }

L: { 1 }
// L option -> how mbox to manage virtual card(s) with level 0
// ( only for peer(s) who have and can re-share virtual cards but don't want to use LEVEL 0 card(s) for them self)
// L: { x }
// x=0 -> don't load any virtual cards with LEVEL 0, you can't use them for your self
// x=1 -> load all virtual cards with LEVEL 0 ,you will be using them for your self
// default 1

If you run Mbox on a server then you can't use level0 cards so you have to set:
L: { 0 }


About the cwshare.cfg:

If you don't use a bracket and you must set some other options after the bracket then don't leave it empty.
Put a zero in it so Mbox knows it's not used.
Example: C: { 127.0.0.1 15000 dummy dummy 01 02 03 04 05 06 07 08 09 10 11 12 13 14 } { 0 } { 0 }

When using Mbox and Newcs on the same box/server then Mbox can see those cards as local.
But you must make a connection ( C-line in cwshare.cfg) with IP 127.0.0.1.
Only then you will have these cards as local in your Mbox server.

About D line in cwshare.cfg file ...
Now you can set what providers boxids you want to re-share with another peer(s)

This is standard D line
=======================
D: { IP { port1 port2 { pass { level1 level2 }}}}


This is my new upgraded D line
===============================
D: { IP { port1 port2 { pass { level1 level2 }}}}
{ 0000 } { 0 } send filter
{ 0000 } { 0 } receive filter


D: { IP { port1 port2 { pass { level1 level2 }}}}
{ xxyy !!in hex!!!} { provid-boxid-boxid;provid;provid-boxid; ...!!in hex!!!} send filter
{ xxyy !!in hex!!!} { provid-boxid-boxid;provid;provid-boxid; ...!!in hex!!!} receive filter

for both brackets

xx -> 00 disabled
xx -> 01 allow only this cards for provider to be re-shared received
xx -> 02 denied only this cards for provider to be re-shared received

yy -> how many providers is in next bracket don't calculate boxids

1st example:
============

D: { IP { port1 port2 { pass { level1 level2 }}}}
{ 0102 } { 0001006A;0001006C-0A0A-0B0B; }
{ 0102 } { 00010080;00010081-0A0A-0B0B; }



{ 0102 } { 0001006A;0001006C-0A0A-0B0B; }

xx is 01 ,ALL cards for (0001006A) provider is SENT to peer AND cards with boxid 0A0A,0B0B for provider 0001006C, ALL other providers(cards) will NOT be sent!!

yy is 02 ,there is only 2 providers in next bracket don't calculate boxids


{ 0102 } { 00010080;00010081-0A0A-0B0B; }
xx is 01 ,ALL cards for (00010080) provider is RECEIVED from peer AND cards with boxid 0A0A,0B0B for provider 00010081, ALL other providers will be IGNORED!!

yy is 02 ,there is only 2 providers in next bracket don't calculate boxids



2nd example:
============

D: { IP { port1 port2 { pass { level1 level2 }}}}
{ 0202 } { 0001006A;0001006C-0A0A-0B0B; }
{ 0202 } { 00010080;00010081-0A0A-0B0B; }


{ 0202 } { 0001006A;0001006C-0A0A-0B0B; }
xx is 02 ,ALL cards for this (0001006A) provider is NOT sent to peer AND cards with boxid 0A0A,0B0B for provider 0001006C, ALL other providers(cards) are !!

yy is 02 ,there is only 2 providers in next bracket don't calculate boxids


{ 0202 } { 00010080;00010081-0A0A-0B0B; }
xx is 02 ,ALL cards for (00010080) provider is NOT RECEIVED from peer AND cards with boxid 0A0A,0B0B for provider 00010081, all other providers will be received!!

yy is 02 ,there is only 2 providers in next bracket don't calculate boxids




NOTICE: MBOX WILL NOT COMPLAIN IF YOU USE OLD D LINE STYLE !!!!!!!!!!!!!



Connecting to newcamd server program Newcs
==========================================

example:
C: { server_ip server_listening_port username password des_key } { x } { xxxxyyyy:xxxxyyyy;......}
C: { 127.0.0.1 15000 dummy dummy 01 02 03 04 05 06 07 08 09 10 11 12 13 14 } { 10 } { 0100006a:0100006B;}

[second bracket] -> { x } max. number ecms in buffer ,decimal !!!!!

[third bracket] { 0100006a:0100006B;} is used if you want to change caidprovid from what newcs detected to caid provider to use with gboxx protocol so 0100006A will be 0100006B in gboxx protocol




Resending ECM(s) on timeout interval
====================================
O: { xxxx yyyy }

example:
O: { 4000 2000 }

4000 (4 seconds)-> resend current ecm on boxid if no dcw
2000 (2 seconds)-> wait 2 more seconds for dcw ,if no dcw on time resend ecm(s) to all boxid's



NDS system ->Resending ECM(s) on timeout interval
=================================================
N: { xxxx yyyy }

example:
N: { 400 200 }

default disabled...


Add more cards for CaidProvid
=============================
X+: { xxxxyyyy:zz;xxxxyyyy:zz; } // zz -> max. is 30 !!!!!

example:
X+: { 0100006A:15; }

With X+ active, for caidprovid:0100006A max. cards for use is 15.



About the 12000.list or the port.list:
You need the 12000.list file to run Mbox with your local cards!!!
If you are sure that your card can decrypt all Sids then put ONLY this in the port.list file:
SF: { 0000 }

Now you must make file called "port.list" in
K: path (look your settings in mbox.cfg)

"Port" is newcs port, look into the newcs.xml file and search for newcamd_port.

Code:

<device>
......
<newcamd_port>12000</newcamd_port>
.......
</device>

So the file will be called 12000.list.
If you have <newcamd_port>17050</newcamd_port> then the filename will be 17050.list


Pls use SID pids , CHIDs for Irdeto or G line, because now mbox send only one ECM and wait response from newcs before it send new ECM.

//this is for forbidden SID pids or Irdeto chids ..
//example
SF: { 04A0 } -> forbidden SID pid -> your card cant decrypt this channel
SF: { 0220 }
IF: { 0203 } -> forbidden Irdeto ChID -> your card cant decrypt this ChID
IF: { 0302 }
G: { 0100006A } -> don't list and re-share this provider from your card if card cant decrypt that, mbox will just flood newcs with bad ECMs for this provider.


//max forbidden SID pids or ChIDs is 150.
//max G lines is 15.


//OR to enable SID pids or Irdeto chids
//example
SA: { 04A0 } -> enable SID pid -> your card can decrypt this channel
SA: { 0220 }
IA: { 0203 } -> enable Irdeto ChID -> your card can decrypt this ChID
IA: { 0302 }
G: { 0100006A } -> don't list and re-share this provider from your card if card cant decrypt that, mbox will just flood newcs with bad ECMs for this provider.

//NOTE: YOU CANT MIX FORBIDDEN AND ENABLED PIDS.



About the add.data file:

You don't need the add.data file to run Mbox!!!

The add.data file gives you the option to:

- change I,X,O,N line
- to delete running D line
- to add new D line(without filter rules)
- to resend "R" hello msg to all peers while mbox is running.

Write new values in "add.data" file and put it in folder from P: line. (look your settings in mbox.cfg)

NOTE: Max time to wait before changes take affect is 2 minutes, new values for I,X,O,N will NOT be saved in cwshare.cfg but new D or C line will be saved.
"add.data" file will be deleted after reading (read add.data.example) !

#D: { ip { port1 port2 { pass { level1 level 2 }}}} -> remove running D line
D: { ip { port1 port2 { pass { level1 level 2 }}}} -> add new D line without restarting mbox,new D line will be saved in cwshare.cfg
R ->Resend hello msg to all peers
X: { x } -> Change running X value
I: { x } -> Change running I value
O: { xxxx yyyy } -> Change running timeout intervals
N: { xxxx yyyy } -> Change running timeout intervals for NDS system
C: { server_ip server_listening_port username password des_key } { x } { xxxxyyyy:xxxxyyyy;......} -> add new C line
#