|
From: Miriam P. V. <mir...@gm...> - 2006-05-16 12:37:23
|
The default configuration of the client is moved to the application
resource file
(client/src/erlang_implementation/ebin/client_application.in)
{application, client_application,
[
{description, "SERVAL client"},
{vsn, "serval_client_0_2"},
{modules, [client_application, client_supervisor_topsup,
client_genserver_taptoclient]},
{registered, []},
{applications, [kernel,stdlib]},
{env, [{file_log_name,'./erlang_node.log'},
{server_address,'localhost'},
{server_port,5443},
{connection_type,'ssl'},
{keep_alive_option,'on'},
{client_time_interval,15000},
{ssl_cert_file,
"@TOP_FOLDER@/client/c_implementation/certs/client.cert"},
{ssl_cert_key,
"@TOP_FOLDER@/client/c_implementation/certs/client.key"},
{ssl_ca_cert_file,
"@TOP_FOLDER@/client/c_implementation/certs/ca-cert.pem"},
{tap_ethernet_mac,"FA:23:56:E4:FF:FA"},
{tap_driver,'tuntap'},
{c_node_name,'c_node@localhost'},
{default_server,'localhost'},
{default_command_port,'6690'},
{default_data_port,'6690'},
{default_protocol,'udp'},
{default_promiscous_mode,'off'},
{default_user_login,'user1'},
{default_user_password,'pass1'},
{default_vlans_to_join,{['vlan1',
'vlan2']} },
{default_vlans_to_create,{[
{'vlan1','this is an vlan',[]},
{'vlan2','this is an vlan2',[]}
]}},
{shell_node_name,'shell_node@localhost'}
]},
{mod, {client_application,[]}}
]
}.
This will be loaded by the administration_data.
(Im proud of my administration_data VO ) ;)
-export([start_link/0,
get_value/1,
set_value/2
]).
for instance:
miriam@miriam:~/serval/src/client/erlang_implementation/ebin$ ./run.sh
Erlang (BEAM) emulator version 5.4.6 [source] [threads:0]
Eshell V5.4.6 (abort with ^G)
(client@localhost)1> toolbar:start().
<0.57.0>
(client@localhost)2>
client_genserver_administration_data:get_value(default_configuration).
{{ok,localhost},
{ok,'6690'},
{ok,'6690'},
{ok,udp},
{ok,off},
{ok,user1},
{ok,pass1},
{ok,{[{vlan1,'this is an vlan',[]},{vlan2,'this is an vlan2',[]}]}},
{ok,{[vlan1,vlan2]}}}
==================================
the interfaz exports.
-export([start_link/0,
reserveInterface/1,
unreserveInterface/0,
connectClientToServer/3,
disconnectClientFromServer/0,
createVlan/3,
deleteVlan/1,
joinVlan/1,
leaveVlan/1,
login/2,
setPromiscousMode/1,
loadDefaultConfiguration/0,
getState/0
]).
Interfaz is calling the boot message sender..
Now Im linking boot messages to the interfaz
Cheers!
|