SLP
Summary
Functions
Deregisters a service from SLP
Finds services that are registered with SLP
Registers a service with SLP
Callback implementation for c::application.start/2
Types
slp_response ::
:ok |
{:ok, [{:key, binary}]} |
{:error, binary}
Functions
Deregisters a service from SLP.
Returns an error if the url is not already registered.
## Parameters:
* service_url : string which must conform to the SLP Service URL format.
## Examples
iex> SLP.register "foo.bar:http://127.0.0.1:3002", [foo: "bar", bar: "baz"], 3000
:ok
iex> SLP.deregister "foo.bar:http://127.0.0.1:3002"
:ok
iex> SLP.deregister "foo.bar:http://127.0.0.1:3002"
{:error, "Invalid Registration"}
## Examples
iex> SLP.register "foo.bar:http://127.0.0..1:3005", [foo: "bar", bar: "baz"]
iex> SLP.find_attributes "foo.bar:http://127.0.0..1:3005", [:foo, :bar]
{:ok, [foo: "bar", bar: "baz"]}
iex> SLP.deregister "foo.bar:http://127.0.0..1:3005"
:ok
Finds services that are registered with SLP.
## Parameters
* service_type : string which must conform to the SLP Service type format.
* scope_list : A list of scopes to search.
* filter : An LDAPv3 search filter to apply to the search. Omit this to include all results.
## Examples
iex> SLP.register "foo.bar:http://127.0.0.1:3003"
...> SLP.register "foo.bar:http://127.0.0.1:3004"
...> SLP.find_services "foo.bar"
{:ok, ["foo.bar:http://127.0.0.1:3003","foo.bar:http://127.0.0.1:3004"]}
Specs
register(binary, [{:key, binary}], integer) :: slp_response
Registers a service with SLP.
## Parameters
* service_url : string which must conform to the SLP Service URL format.
* attributes : A list of attributes to set on the record.
* lifetime : The number of seconds the service will be registered for.
Must be an integer less than or equal to 65535. If set to 65535 the service will be
registered for the lifetime of the SLP application.
## Examples
iex> SLP.register "foo.bar:http://127.0.0.1:3000"
:ok
iex> SLP.register "foo.bar:http://127.0.0.1:3001", [foo: "bar", bar: "baz"], 65535
:ok
iex> SLP.register "foo.bar", [foo: "bar", bar: "baz"], 3000
{:error, "Invalid Registration"}
iex> SLP.deregister "foo.bar:http://127.0.0.1:3000"
...> SLP.deregister "foo.bar:http://127.0.0.1:3001"
:ok