#
#       cs2gbox gate 2.01
#
#       cs2gbox is a utility that connects newcamd cardsever/cardspider to
#       a gbox network.
#
#       You can run it on a x86 (linux or windows) or on a PPC.
#       It does not access the com ports, demux or similar, so you can run it
#       the same time you run gbox, newcamd, or some other software.
#
#       first scenario
#       dbox2 i running gbox, gbox is manageing the multicams, cs2gbox is
#       used to add several cardservers/cardspider to the network.
#
#       second scenario
#       cs2gbox i running standalone on a PC (win32 or linux) simply to
#       add several cardservers/cardspider to the network.
#
#       thirth scenario
#       dbox2 i running gbox, cardserver is manageing the multicams, cs2gbox
#       is used connect the gbox with the local cardserver and to add several
#       cardservers/cardspider to the network.
#
#       etc ...
#
#       The cardserver/cardspider is returning only the CW's, without
#       information about the ECM, so it is not possible to determinate
#       with CW's comes from with ECM. Even if a message ID is used,
#       this will not word, it seems the cardserver has only buffer for
#       2 ECM's for every client, or is interpreting the multiple ECM's
#       as a channel change, and is discarding the first send ECM's
#
#       For that reason cs2gbox is sending on every port only 1 ecm at the
#       time, and waits for a response before it sends the next one. This is
#       working well with cardservers, the imideatly response with the cw's
#       or a decode failed message.
#
#       But the cardspider waits for several second and hopes to get the
#       cw's from somewere, for that time that port is blocked and not
#       accessable for other ecm's. This leads to resyncs and picture
#       freezings.
#       For that reason try to avoid !!! cardspider !!!, use them only if it
#       is expected that they will decode the cw's successfully. (the
#       spider has several cards from the same provider in the net)
#
#       A other reason to avoid cardspiders, is that there is no unique
#       card ID . If some card is connected to several cardspiders, and
#       several of these card spiders to the gbox net, the gbox will
#       thing that there are multiple cards presend, and will send the same
#       ECM's to these card spiders, and the cardspiders to the card. This
#       will make only more trafic, more work for the card, and could even
#       prevent the channel decoding.
#
#       In case the cs2gbox is connected to a cardserver, every card will
#       become a unique ID, even more cs2gbox are connected to the cardserver,
#       the gbox will send only 1 ECM to the card, choseing the shortest
#       path.
#
#       So !!!!!!!!!! PLEASE !!!!!!!!!!! avoid cardspider !!!!!!!!!!!!!
#       USE ONLY CARSERVER
#
#       Note* On a callback the cs2gbox remembar the servers that make the
#       callback and returns a login_failed. The cs2gbox will relogin to these
#       servers after a delay that is given in the cfg file. This is to avoid
#       a cs2gbox blockig (several seconds), coused by a callback loging from
#       a server that has several ports.
#


# Options
#    print infos/errors
#    |  print Hello
#    |  |  print ecm/cw
#    |  |  |  print CW's
#    |  |  |  |  try to reconnect imidiatly after lost connection
#    |  |  |  |  |  print on screen
#    |  |  |  |  |  |  print into debug.txt
#    |  |  |  |  |  |  |  on callback reconnect after 30 seconds
#    |  |  |  |  |  |  |  |  on login failed, retry afer 5 seconds (only 1 time)
#    |  |  |  |  |  |  |  |  |  try to connect to unconnected server every hour (3600 seconds)
#    |  |  |  |  |  |  |  |  |  |    minimum time distance (in seconds) between login's (force login delay)
#    |  |  |  |  |  |  |  |  |  |    |  keep internet alive every 360 seconds
#    |  |  |  |  |  |  |  |  |  |    |  |   ping cardservers (keep alive) every 360 after last activity
#    |  |  |  |  |  |  |  |  |  |    |  |   |   connect timeout
P: { 01 00 01 00 01 01 01 30 05 3600 05 360 360 1 }

#    ignore
#    caid  provider = for all systems except via
#    ca provider    = for viaccess
#
I: { 01 00 00 00 }
I: { 01 00 00 71 }
I: { 01 00 00 72 }
I: { 01 00 00 73 }
I: { 05 FF F4 A0 }
I: { 05 02 0A 10 }
I: { 05 02 0A 20 }
I: { 05 02 0A 30 }
I: { 05 02 0A 40 }

#    My dbox2                   password
M: { 192.168.0.24             { 87654321 }}

#    gbox Friends               password    cod
D: { 192.168.0.135            { 2499 2499 { aabbccdd { 5 5 }}}}
D: { friend.homeip.net        { 2499 2499 { abcdef12 { 5 5 }}}}

#    name  dns/ip        port  user   pass    callback configkey
C: { dbox2 192.168.0.104 10001 myname passwo1 12000 01 02 03 04 05 06 07 08 09 10 11 12 13 14 }
C: { dbox2 192.168.0.104 10002 myname passwo1 12000 01 02 03 04 05 06 07 08 09 10 11 12 13 14 }
C: { hdbox mee.homeip.net 6008 other1 mypassword 13000 11 22 33 44 55 66 77 88 99 10 11 12 13 14 }
