Skip to content

Commit

Permalink
Updated schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed Apr 14, 2014
1 parent 843565a commit e605929
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
18 changes: 1 addition & 17 deletions priv/mdns_server.schema
Expand Up @@ -11,26 +11,10 @@
{datatype, string}]}.

%% @doc The TCP endpoint that will be broadcasted.
{mapping, "mdns.server.endpoint", "mdns_server_lib.endpoint",
{mapping, "mdns.server.endpoint", "mdns_server_lib.listener",
[{default, {"127.0.0.1", 4223}},
{datatype, ip}]}.

{translation,
"mdns_server_lib.ip",
fun(Conf) ->
{IP, _Port} = cuttlefish_util:conf_get_value("mdns.server.endpoint", Conf),
IP
end
}.

{translation,
"mdns_server_lib.port",
fun(Conf) ->
{_IP, Port} = cuttlefish_util:conf_get_value("mdns.server.endpoint", Conf),
Port
end
}.

%% @doc The livetime of a broadcast, alsot he rebroadcast frequency
{mapping, "mdns.server.ttl", "mdns_server_lib.ttl",
[{default, 120},
Expand Down
2 changes: 1 addition & 1 deletion src/mdns_server_lib.app.src
@@ -1,7 +1,7 @@
{application, mdns_server_lib,
[
{description, ""},
{vsn, "0.1.13"},
{vsn, "0.1.14"},
{registered, []},
{applications, [
kernel,
Expand Down
10 changes: 8 additions & 2 deletions src/mdns_server_lib_app.erl
Expand Up @@ -12,8 +12,14 @@
start(_StartType, _StartArgs) ->
{ok, Domain} = application:get_env(mdns_server_lib, domain),
{ok, Service} = application:get_env(mdns_server_lib, service),
{ok, IP} = application:get_env(mdns_server_lib, ip),
{ok, Port} = application:get_env(mdns_server_lib, port),
{IP, Port} = case application:get_env(mdns_server_lib, listener) of
{ok, R} ->
R;
_ ->
{ok, IPx} = application:get_env(mdns_server_lib, ip),
{ok, Portx} = application:get_env(mdns_server_lib, port),
{IPx, Portx}
end,
{ok, TTL} = application:get_env(mdns_server_lib, ttl),
MDNSConfig0 = [{port, 5353},
{address, {224, 0, 0, 251}},
Expand Down

0 comments on commit e605929

Please sign in to comment.