From 474dfaf674ac8746367ff856534ef0b63afc6307 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Tue, 1 Sep 2015 17:32:34 +0200 Subject: inets: Align with alphabetical order and clean local anchor handling Functions in the same module can be referenced as #Function-Arity, no need to make special markers for them. --- lib/inets/doc/src/httpc.xml | 255 +++++++++++++++---------------- lib/inets/doc/src/httpd.xml | 41 ++--- lib/inets/doc/src/httpd_util.xml | 109 ++------------ lib/inets/doc/src/inets.xml | 22 +-- lib/inets/doc/src/mod_auth.xml | 220 ++++++++++++--------------- lib/inets/doc/src/mod_security.xml | 50 +++---- lib/inets/doc/src/tftp.xml | 300 ++++++++++++++++++------------------- 7 files changed, 420 insertions(+), 577 deletions(-) (limited to 'lib/inets') diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index 70400d1ca7..9a24226e78 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -146,11 +146,112 @@

The client can be stopped using inets:stop(httpc, Pid) or inets:stop(httpc, Profile).

- - + + + cancel_request(RequestId) -> + cancel_request(RequestId, Profile) -> ok + Cancels an asynchronous HTTP request. + + RequestId = request_id() - A unique identifier as returned + by request/4 + Profile = profile() | pid() + When started stand_alone. + + +

Cancels an asynchronous HTTP request. Notice that this does not guarantee + that the request response is not delivered. Because it is asynchronous, + the request can already have been completed when the cancellation arrives. +

+
+
+ + + cookie_header(Url) -> + cookie_header(Url, Profile | Opts) -> header() | {error, Reason} + cookie_header(Url, Opts, Profile) -> header() | {error, Reason} + Returns the cookie header that would have been sent when + making a request to URL using the profile Profile. + + Url = url() + Opts = [cookie_header_opt()] + Profile = profile() | pid() + When started stand_alone. + cookie_header_opt() = {ipv6_host_with_brackets, boolean()} + + +

Returns the cookie header that would have been sent + when making a request to Url using profile Profile. + If no profile is specified, the default profile is used.

+

Option ipv6_host_with_bracket deals with how to + parse IPv6 addresses. For details, + see argument Options of + request/4,5.

+
+
+ + + get_options(OptionItems) -> {ok, Values} | {error, Reason} + get_options(OptionItems, Profile) -> {ok, Values} | {error, Reason} + Gets the currently used options. + + OptionItems = all | [option_item()] + option_item() = proxy | + https_proxy + max_sessions | + keep_alive_timeout | + max_keep_alive_length | + pipeline_timeout | + max_pipeline_length | + cookies | + ipfamily | + ip | + port | + socket_opts | + verbose + Profile = profile() | pid( + When started stand_alone. + Values = [{option_item(), term()}] + Reason = term() + + +

Retrieves the options currently used by the client.

+
+
+ + + info() -> list() + info(Profile) -> list() + Produces a list of miscellaneous information. + + Profile = profile() | pid() + When started stand_alone. + + +

Produces a list of miscellaneous information. + Intended for debugging. + If no profile is specified, the default profile is used.

+
+
+ + + + reset_cookies() -> void() + reset_cookies(Profile) -> void() + Resets the cookie database. + + Profile = profile() | pid() + When started stand_alone. + + +

Resets (clears) the cookie database for the specified + Profile. If no profile is specified the default profile + is used.

+
+
+ request(Url) -> request(Url, Profile) -> {ok, Result} | {error, Reason} @@ -166,8 +267,6 @@

Equivalent to httpc:request(get, {Url, []}, [], []).

- -
@@ -353,7 +452,7 @@

Socket options to be used for this and subsequent requests.

Overrides any value set by function - set_options.

+ set_options.

The validity of the options is not checked in any way.

Notice that this can change the socket behavior @@ -361,7 +460,7 @@ for an already existing one, and therefore an already connected request handler.

By default the socket options set by function - set_options/1,2 + set_options/[1,2] are used when establishing a connection.

@@ -418,31 +517,10 @@ - - - - - - - cancel_request(RequestId) -> - cancel_request(RequestId, Profile) -> ok - Cancels an asynchronous HTTP request. - - RequestId = request_id() - A unique identifier as returned - by request/4 - Profile = profile() | pid() - When started stand_alone. - - -

Cancels an asynchronous HTTP request. Notice that this does not guarantee - that the request response is not delivered. Because it is asynchronous, - the request can already have been completed when the cancellation arrives. -

- -
+ set_options(Options) -> set_options(Options, Profile) -> ok | {error, Reason} @@ -554,56 +632,7 @@ - - - get_options(OptionItems) -> {ok, Values} | {error, Reason} - get_options(OptionItems, Profile) -> {ok, Values} | {error, Reason} - Gets the currently used options. - - OptionItems = all | [option_item()] - option_item() = proxy | - https_proxy - max_sessions | - keep_alive_timeout | - max_keep_alive_length | - pipeline_timeout | - max_pipeline_length | - cookies | - ipfamily | - ip | - port | - socket_opts | - verbose - Profile = profile() | pid( - When started stand_alone. - Values = [{option_item(), term()}] - Reason = term() - - -

Retrieves the options currently used by the client.

- - -
-
- - - stream_next(Pid) -> ok - Triggers the next message to be streamed, that is, - the same behavior as active ones for sockets. - - - Pid = pid() - As received in the stream_start message - - -

Triggers the next message to be streamed, that is, - the same behavior as active ones for sockets.

- - - -
-
- + store_cookies(SetCookieHeaders, Url) -> store_cookies(SetCookieHeaders, Url, Profile) -> ok | {error, Reason} @@ -620,56 +649,27 @@ in the client profile cookie database. Call this function if option cookies is set to verify. If no profile is specified, the default profile is used.

- - - -
- - - cookie_header(Url) -> - cookie_header(Url, Profile | Opts) -> header() | {error, Reason} - cookie_header(Url, Opts, Profile) -> header() | {error, Reason} - Returns the cookie header that would have been sent when - making a request to URL using the profile Profile. - - Url = url() - Opts = [cookie_header_opt()] - Profile = profile() | pid() - When started stand_alone. - cookie_header_opt() = {ipv6_host_with_brackets, boolean()} - - -

Returns the cookie header that would have been sent - when making a request to Url using profile Profile. - If no profile is specified, the default profile is used.

-

Option ipv6_host_with_bracket deals with how to - parse IPv6 addresses. For details, - see argument Options of - request/4,5.

- -
- - reset_cookies() -> void() - reset_cookies(Profile) -> void() - Resets the cookie database. + stream_next(Pid) -> ok + Triggers the next message to be streamed, that is, + the same behavior as active ones for sockets. + - Profile = profile() | pid() - When started stand_alone. + Pid = pid() + As received in the stream_start message -

Resets (clears) the cookie database for the specified - Profile. If no profile is specified the default profile - is used.

+

Triggers the next message to be streamed, that is, + the same behavior as active ones for sockets.

- + +
- - + which_cookies() -> cookies() which_cookies(Profile) -> cookies() @@ -686,8 +686,6 @@

Produces a list of the entire cookie database. Intended for debugging/testing purposes. If no profile is specified, the default profile is used.

- -
@@ -707,25 +705,10 @@

Produces a slightly processed dump of the session database. It is intended for debugging. If no profile is specified, the default profile is used.

- - - - info() -> list() - info(Profile) -> list() - Produces a list of miscellaneous information. - - Profile = profile() | pid() - When started stand_alone. - - -

Produces a list of miscellaneous information. - Intended for debugging. - If no profile is specified, the default profile is used.

-
-
+
diff --git a/lib/inets/doc/src/httpd.xml b/lib/inets/doc/src/httpd.xml index 470359d0b2..b6d3c5d39b 100644 --- a/lib/inets/doc/src/httpd.xml +++ b/lib/inets/doc/src/httpd.xml @@ -927,7 +927,6 @@ text/plain asc txt - info(Pid) -> info(Pid, Properties) -> [{Option, Value}] Fetches information about the HTTP server. @@ -953,8 +952,6 @@ text/plain asc txt - - info(Address, Port) -> info(Address, Port, Profile) -> info(Address, Port, Profile, Properties) -> [{Option, Value}] @@ -983,7 +980,6 @@ text/plain asc txt - reload_config(Config, Mode) -> ok | {error, Reason} Reloads the HTTP server configuration without restarting the server. @@ -1108,7 +1104,6 @@ text/plain asc txt
- Module:do(ModData)-> {proceed, OldData} | {proceed, NewData} | {break, NewData} | done Called for each request to the web server. @@ -1164,7 +1159,6 @@ text/plain asc txt - Module:load(Line, AccIn)-> eof | ok | {ok, AccOut} | {ok, AccOut, {Option, Value}} | {ok, AccOut, [{Option, Value}]} | {error, Reason} Converts a line in an Apache-like config file to an {Option, Value} tuple. @@ -1186,9 +1180,23 @@ text/plain asc txt

- + + + Module:remove(ConfigDB) -> ok | {error, Reason} + Callback function that is called when the web server is closed. + + ConfigDB = ets_table() + Reason = term() + + +

When httpd is shut down, it tries to execute + remove/1 in each Erlang web server callback module. The + programmer can use this function to clean up resources + created in the store function.

+
+
+ - Module:store({Option, Value}, Config)-> {ok, {Option, NewValue}} | {error, Reason} Checks the validity of the configuration options. @@ -1210,22 +1218,6 @@ text/plain asc txt implemented by this particular callback module.

- - - - Module:remove(ConfigDB) -> ok | {error, Reason} - Callback function that is called when the web server is closed. - - ConfigDB = ets_table() - Reason = term() - - -

When httpd is shut down, it tries to execute - remove/1 in each Erlang web server callback module. The - programmer can use this function to clean up resources - created in the store function.

-
-
@@ -1233,7 +1225,6 @@ text/plain asc txt
- parse_query(QueryString) -> [{Key,Value}] Parses incoming data to erl and eval scripts. diff --git a/lib/inets/doc/src/httpd_util.xml b/lib/inets/doc/src/httpd_util.xml index 439a01877f..0f498ba2fc 100644 --- a/lib/inets/doc/src/httpd_util.xml +++ b/lib/inets/doc/src/httpd_util.xml @@ -53,8 +53,6 @@ the Erlang date format. DateString must be in one of the three date formats defined in RFC 2616.

- -
@@ -69,25 +67,9 @@

create_etag/1 calculates the Etag for a file from its size and time for last modification. FileInfo is a record defined in kernel/include/file.hrl.

- - - - - - - decode_hex(HexValue) -> DecValue - Converts a hexadecimal value into its decimal equivalent. - - HexValue = DecValue = string() - - -

Converts the hexadecimal value HexValue into its - decimal equivalent (DecValue).

- -
- + day(NthDayOfWeek) -> DayOfWeek Converts the day of the week @@ -97,63 +79,37 @@ DayOfWeek = string() -

day/1 converts the day of the week (NthDayOfWeek) from an integer (1-7) to an abbreviated string, that is:

1 = "Mon", 2 = "Tue", ..., 7 = "Sat".

- -
- flatlength(NestedList) -> Size - Computes the size of a possibly nested list. + decode_hex(HexValue) -> DecValue + Converts a hexadecimal value into its decimal equivalent. - NestedList = list() - Size = integer() + HexValue = DecValue = string() - -

flatlength/1 computes the size of the possibly nested - list NestedList, which can contain binaries.

- - +

Converts the hexadecimal value HexValue into its + decimal equivalent (DecValue).

- - hexlist_to_integer(HexString) -> Number @@ -165,8 +121,6 @@

hexlist_to_integer converts the hexadecimal value of HexString to an integer.

- -
@@ -178,11 +132,8 @@ HexString = string() -

integer_to_hexlist/1 returns a string representing Number in a hexadecimal form.

- -
@@ -205,8 +156,6 @@ returned. lookup/2 returns undefined and lookup/3 returns Undefined if no Value is found.

- - @@ -221,14 +170,11 @@ Undefined = term() -

lookup_mime returns the MIME type associated with a specific file suffix as specified in the file mime.types (located in the config directory).

- -
@@ -244,7 +190,6 @@ Undefined = term() -

lookup_mime_default returns the MIME type associated with a specific file suffix as specified in the mime.types file (located in the @@ -252,8 +197,6 @@ config directory). If no appropriate association is found, the value of DefaultType is returned.

- -
@@ -267,7 +210,6 @@ Message = string() -

message/3 returns an informative HTTP 1.1 status string in HTML. Each StatusCode requires a specific PhraseArgs: @@ -290,8 +232,6 @@

string(): A string describing why the service was unavailable.

- -
@@ -303,12 +243,9 @@ Month = string() -

month/1 converts the month NthMonth as an integer (1-12) to an abbreviated string, that is:

1 = "Jan", 2 = "Feb", ..., 12 = "Dec".

- -
@@ -324,8 +261,6 @@

multi_lookup extracts all {Key,Value} tuples from an ETSTable and returns all Values associated with Key in a list.

- - @@ -341,7 +276,6 @@ HTTP 1.1 StatusCode, for example, 200 is "OK" and 201 is "Created". For more information, see RFC 2616.

- @@ -354,12 +288,9 @@ RFC1123Date = string() -

rfc1123_date/0 returns the current date in RFC 1123 format. rfc_date/1 converts the date in the Erlang format to the RFC 1123 date format.

- -
@@ -373,14 +304,11 @@ N = integer -

split/3 splits String in N chunks using RegExp. split/3 is equivalent to regexp:split/2 with the exception that N defines the maximum number of fields in FieldList.

- -
@@ -394,13 +322,10 @@ Path = QueryString = PathInfo = string() -

split_script_path/1 is equivalent to split_path/1 with one exception. If the longest possible path is not a regular, accessible, and executable file, then not_a_script is returned.

- -
@@ -412,7 +337,6 @@ RequestLine = Path = QueryStringOrPathInfo = string() -

split_path/1 splits RequestLine in a file reference (Path), and a QueryString or a PathInfo string as specified in @@ -428,8 +352,6 @@ Path, isolated with a /, is regarded as PathInfo. The resulting Path is decoded using decode_hex/1 before delivery.

- -
@@ -441,12 +363,9 @@ String = Stripped = string() -

strip/1 removes any leading or trailing linear white space from the string. Linear white space is to be read as horizontal tab or space.

- -
@@ -457,7 +376,6 @@ FileName = Suffix = string() -

suffix/1 is equivalent to filename:extension/1 with the exception that Suffix is returned without a leading dot (.).

@@ -466,7 +384,6 @@
- SEE ALSO

httpd(3)

diff --git a/lib/inets/doc/src/inets.xml b/lib/inets/doc/src/inets.xml index 2bb5427465..5d071c9a48 100644 --- a/lib/inets/doc/src/inets.xml +++ b/lib/inets/doc/src/inets.xml @@ -119,17 +119,6 @@ - - stop() -> ok - Stops the Inets application. - -

Stops the Inets application. See also - application(3).

- - -
-
- start(Service, ServiceConfig) -> {ok, Pid} | {error, Reason} start(Service, ServiceConfig, How) -> {ok, Pid} | {error, Reason} @@ -166,6 +155,17 @@ + + stop() -> ok + Stops the Inets application. + +

Stops the Inets application. See also + application(3).

+ + +
+
+ stop(Service, Reference) -> ok | {error, Reason} Stops a started service of the Inets application or takes diff --git a/lib/inets/doc/src/mod_auth.xml b/lib/inets/doc/src/mod_auth.xml index 8bef025be8..2da2be37ed 100644 --- a/lib/inets/doc/src/mod_auth.xml +++ b/lib/inets/doc/src/mod_auth.xml @@ -34,11 +34,36 @@

This module provides for basic user authentication using textual files, Dets databases, or Mnesia databases.

- -
+ + add_group_member(GroupName, UserName, Options) -> true | {error, Reason} + add_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} + add_group_member(GroupName, UserName, Address, Port, Dir) -> true | {error, Reason} + Adds a user to a group. + + GroupName = string() + UserName = string() + Options = [Option] + Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} + Port = integer() + Address = {A,B,C,D} | string() | undefined + Dir = string() + AuthPassword = string() + Reason = term() + + +

add_group_member/3, add_group_member/4, and + add_group_member/5 each + adds a user to a group. If the group does not exist, it + is created and the user is added to the group. Upon successful + operation, this function returns true. + When add_group_members/3 + is called, options Port and Dir are mandatory.

+
+
+ add_user(UserName, Options) -> true| {error, Reason} add_user(UserName, Password, UserData, Port, Dir) -> true | {error, Reason} @@ -57,53 +82,45 @@ Reason = term() - -

add_user/2, add_user/5, and add_user/6 each adds a user to the user database. If the operation is successful, this function returns true. If an error occurs, {error,Reason} is returned. When add_user/2 is called, options Password, UserData, Port, and Dir are mandatory.

- -
- - delete_user(UserName,Options) -> true | {error, Reason} - delete_user(UserName, Port, Dir) -> true | {error, Reason} - delete_user(UserName, Address, Port, Dir) -> true | {error, Reason} - Deletes a user from the user database. + + delete_group(GroupName, Options) -> true | {error,Reason} <name>delete_group(GroupName, Port, Dir) -> true | {error, Reason} + delete_group(GroupName, Address, Port, Dir) -> true | {error, Reason} + Deletes a group. - UserName = string() Options = [Option] Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} Port = integer() Address = {A,B,C,D} | string() | undefined Dir = string() + GroupName = string() AuthPassword = string() Reason = term() - -

delete_user/2, delete_user/3, and delete_user/4 - each deletes a user from the user database. - If the operation is successful, this function returns true. - If an error occurs, {error,Reason} is returned. - When delete_user/2 is called, options Port and Dir - are mandatory.

- - +

delete_group/2, delete_group/3, and delete_group/4 + each deletes the group specified and returns true. + If there is an error, {error, Reason} is returned. + When delete_group/2 is called, option + Port and Dir are mandatory.

- - get_user(UserName,Options) -> {ok, #httpd_user} |{error, Reason} - get_user(UserName, Port, Dir) -> {ok, #httpd_user} | {error, Reason} - get_user(UserName, Address, Port, Dir) -> {ok, #httpd_user} | {error, Reason} - Returns a user from the user database. + + delete_group_member(GroupName, UserName, Options) -> true | {error, Reason} + delete_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} + delete_group_member(GroupName, UserName, Address, Port, Dir) -> true | {error, Reason} + Removes a user from a group. + GroupName = string() UserName = string() Options = [Option] Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} @@ -114,51 +131,46 @@ Reason = term() - -

get_user/2, get_user/3, and get_user/4 each - returns an httpd_user record containing the userdata for a - specific user. If the user cannot be found, {error, Reason} - is returned. When get_user/2 is called, options Port and Dir - are mandatory.

- - +

delete_group_member/3, delete_group_member/4, and + delete_group_member/5 each deletes a user from a group. + If the group or the user does not exist, + this function returns an error, otherwise true. + When delete_group_member/3 is called, the options Port + and Dir are mandatory.

- + - list_users(Options) -> {ok, Users} | {error, Reason} - list_users(Port, Dir) -> {ok, Users} | {error, Reason} - list_users(Address, Port, Dir) -> {ok, Users} | {error, Reason} - Lists users in the user database. + delete_user(UserName,Options) -> true | {error, Reason} + delete_user(UserName, Port, Dir) -> true | {error, Reason} + delete_user(UserName, Address, Port, Dir) -> true | {error, Reason} + Deletes a user from the user database. + UserName = string() Options = [Option] Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} Port = integer() Address = {A,B,C,D} | string() | undefined Dir = string() - Users = list() AuthPassword = string() - Reason = atom() + Reason = term() - -

list_users/1, list_users/2, and list_users/3 - each returns a list - of users in the user database for a specific Port/Dir. - When list_users/1 is called, options Port and Dir +

delete_user/2, delete_user/3, and delete_user/4 + each deletes a user from the user database. + If the operation is successful, this function returns true. + If an error occurs, {error,Reason} is returned. + When delete_user/2 is called, options Port and Dir are mandatory.

- -
- add_group_member(GroupName, UserName, Options) -> true | {error, Reason} - add_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} - add_group_member(GroupName, UserName, Address, Port, Dir) -> true | {error, Reason} - Adds a user to a group. + get_user(UserName,Options) -> {ok, #httpd_user} |{error, Reason} + get_user(UserName, Port, Dir) -> {ok, #httpd_user} | {error, Reason} + get_user(UserName, Address, Port, Dir) -> {ok, #httpd_user} | {error, Reason} + Returns a user from the user database. - GroupName = string() UserName = string() Options = [Option] Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} @@ -169,48 +181,38 @@ Reason = term() - -

add_group_member/3, add_group_member/4, and - add_group_member/5 each - adds a user to a group. If the group does not exist, it - is created and the user is added to the group. Upon successful - operation, this function returns true. - When add_group_members/3 - is called, options Port and Dir are mandatory.

- - +

get_user/2, get_user/3, and get_user/4 each + returns an httpd_user record containing the userdata for a + specific user. If the user cannot be found, {error, Reason} + is returned. When get_user/2 is called, options Port and Dir + are mandatory.

- - delete_group_member(GroupName, UserName, Options) -> true | {error, Reason} - delete_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} - delete_group_member(GroupName, UserName, Address, Port, Dir) -> true | {error, Reason} - Removes a user from a group. + + list_groups(Options) -> {ok, Groups} | {error, Reason} + list_groups(Port, Dir) -> {ok, Groups} | {error, Reason} + list_groups(Address, Port, Dir) -> {ok, Groups} | {error, Reason} + Lists all the groups. - GroupName = string() - UserName = string() Options = [Option] Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} Port = integer() Address = {A,B,C,D} | string() | undefined Dir = string() + Groups = list() AuthPassword = string() Reason = term() - -

delete_group_member/3, delete_group_member/4, and - delete_group_member/5 each deletes a user from a group. - If the group or the user does not exist, - this function returns an error, otherwise true. - When delete_group_member/3 is called, the options Port +

list_groups/1, list_groups/2, and list_groups/3 + each lists all the groups available. + If there is an error, {error, Reason} is returned. + When list_groups/1 is called, options Port and Dir are mandatory.

- -
- + list_group_members(GroupName, Options) -> {ok, Users} | {error, Reason} list_group_members(GroupName, Port, Dir) -> {ok, Users} | {error, Reason} @@ -228,71 +230,39 @@ Reason = term() -

list_group_members/2, list_group_members/3, and list_group_members/4 each lists the members of a specified group. If the group does not exist or there is an error, {error, Reason} is returned. When list_group_members/2 is called, options Port and Dir are mandatory.

- - -
-
- - - list_groups(Options) -> {ok, Groups} | {error, Reason} - list_groups(Port, Dir) -> {ok, Groups} | {error, Reason} - list_groups(Address, Port, Dir) -> {ok, Groups} | {error, Reason} - Lists all the groups. - - Options = [Option] - Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} - Port = integer() - Address = {A,B,C,D} | string() | undefined - Dir = string() - Groups = list() - AuthPassword = string() - Reason = term() - - - -

list_groups/1, list_groups/2, and list_groups/3 - each lists all the groups available. - If there is an error, {error, Reason} is returned. - When list_groups/1 is called, options Port - and Dir are mandatory.

- -
- - delete_group(GroupName, Options) -> true | {error,Reason} <name>delete_group(GroupName, Port, Dir) -> true | {error, Reason} - delete_group(GroupName, Address, Port, Dir) -> true | {error, Reason} - Deletes a group. + + list_users(Options) -> {ok, Users} | {error, Reason} + list_users(Port, Dir) -> {ok, Users} | {error, Reason} + list_users(Address, Port, Dir) -> {ok, Users} | {error, Reason} + Lists users in the user database. Options = [Option] Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword} Port = integer() Address = {A,B,C,D} | string() | undefined Dir = string() - GroupName = string() + Users = list() AuthPassword = string() - Reason = term() + Reason = atom() - -

delete_group/2, delete_group/3, and delete_group/4 - each deletes the group specified and returns true. - If there is an error, {error, Reason} is returned. - When delete_group/2 is called, option - Port and Dir are mandatory.

- - +

list_users/1, list_users/2, and list_users/3 + each returns a list + of users in the user database for a specific Port/Dir. + When list_users/1 is called, options Port and Dir + are mandatory.

- + update_password(Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason} update_password(Address,Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason} @@ -307,7 +277,6 @@ Reason = term() -

update_password/5 and update_password/6 each updates AuthAccessPassword for the specified directory. If NewPassword is equal to "NoPassword", no password is required to @@ -319,7 +288,6 @@

- SEE ALSO

httpd(3), mod_alias(3)

diff --git a/lib/inets/doc/src/mod_security.xml b/lib/inets/doc/src/mod_security.xml index 7aae98e1cf..9dc32b971b 100644 --- a/lib/inets/doc/src/mod_security.xml +++ b/lib/inets/doc/src/mod_security.xml @@ -35,6 +35,26 @@

Security Audit and Trailing Functionality

+ + + block_user(User, Port, Dir, Seconds) -> true | {error, Reason} + block_user(User, Address, Port, Dir, Seconds) -> true | {error, Reason} + Blocks a user from access to a directory for a certain amount of time. + + User = string() + Port = integer() + Address = {A,B,C,D} | string() | undefined + Dir = string() + Seconds = integer() | infinity + Reason = no_such_directory + + +

block_user/4 and block_user/5 each blocks the user + User from directory Dir for a specified + amount of time.

+
+
+ list_auth_users(Port) -> Users | [] list_auth_users(Address, Port) -> Users | [] @@ -50,7 +70,6 @@ Users = list() = [string()] -

list_auth_users/1, list_auth_users/2, and list_auth_users/3 each returns a list of users that are currently authenticated. Authentications are stored for @@ -71,31 +90,12 @@ Users = list() = [string()] -

list_blocked_users/1, list_blocked_users/2, and list_blocked_users/3 each returns a list of users that are currently blocked from access.

- - block_user(User, Port, Dir, Seconds) -> true | {error, Reason} - block_user(User, Address, Port, Dir, Seconds) -> true | {error, Reason} - Blocks a user from access to a directory for a certain amount of time. - - User = string() - Port = integer() - Address = {A,B,C,D} | string() | undefined - Dir = string() - Seconds = integer() | infinity - Reason = no_such_directory - - - -

block_user/4 and block_user/5 each blocks the user - User from directory Dir for a specified - amount of time.

-
-
+ unblock_user(User, Port) -> true | {error, Reason} unblock_user(User, Address, Port) -> true | {error, Reason} @@ -110,7 +110,6 @@ Reason = term() -

unblock_user/2, unblock_user/3, and unblock_user/4 each removes the user User from the list of blocked users for Port (and Dir).

@@ -123,16 +122,15 @@ SecurityCallbackModule

The SecurityCallbackModule is a user-written module that can receive events from the mod_security Erlang web server API module. - This module only exports the functions - event/4,5, + This module only exports the functions event/[4,5] which are described here.

- event(What, Port, Dir, Data) -> ignored - event(What, Address, Port, Dir, Data) -> ignored + Module:event(What, Port, Dir, Data) -> ignored + Module:event(What, Address, Port, Dir, Data) -> ignored Called whenever an event occurs in mod_security. What = atom() diff --git a/lib/inets/doc/src/tftp.xml b/lib/inets/doc/src/tftp.xml index 78f77f5b91..00d9d53376 100644 --- a/lib/inets/doc/src/tftp.xml +++ b/lib/inets/doc/src/tftp.xml @@ -221,88 +221,57 @@ + - start(Options) -> {ok, Pid} | {error, Reason} - Starts a daemon process. + change_config(daemons, Options) -> [{Pid, Result}] + Changes configuration for all daemons. + Options = [option()] Pid = pid() + Result = ok | {error, Reason} Reason = term() -

Starts a daemon process listening for UDP packets on a - port. When it receives a request for read or write, it spawns - a temporary server process handling the actual transfer - of the (virtual) file.

+

Changes configuration for all TFTP daemon processes.

- +
- read_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason} - Reads a (virtual) file from a TFTP server. + change_config(servers, Options) -> [{Pid, Result}] + Changes configuration for all servers. + - RemoteFilename = string() - LocalFilename = binary | string() Options = [option()] - LastCallbackState = term() + Pid = pid() + Result = ok | {error, Reason} Reason = term() -

Reads a (virtual) file RemoteFilename from a TFTP - server.

-

If LocalFilename is the atom binary, - tftp_binary is used as callback module. It concatenates - all transferred blocks and returns them as one single binary - in LastCallbackState.

-

If LocalFilename is a string and there are no - registered callback modules, tftp_file is used as - callback module. It writes each transferred block to the file - named LocalFilename and returns the number of - transferred bytes in LastCallbackState.

-

If LocalFilename is a string and there are registered - callback modules, LocalFilename is tested against - the regexps of these and the callback module corresponding to - the first match is used, or an error tuple is returned if no - matching regexp is found.

-
+

Changes configuration for all TFTP server processes.

- + +
- write_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason} - Writes a (virtual) file to a TFTP server. + change_config(Pid, Options) -> Result + Changes configuration for a TFTP daemon, server, + or client process. - RemoteFilename = string() - LocalFilename = binary() | string() + Pid = pid() Options = [option()] - LastCallbackState = term() + Result = ok | {error, Reason} Reason = term() -

Writes a (virtual) file RemoteFilename to a TFTP - server.

-

If LocalFilename is a binary, tftp_binary is - used as callback module. The binary is transferred block by - block and the number of transferred bytes is returned in - LastCallbackState.

-

If LocalFilename is a string and there are no - registered callback modules, tftp_file is used as - callback module. It reads the file named LocalFilename - block by block and returns the number of transferred bytes - in LastCallbackState.

-

If LocalFilename is a string and there are registered - callback modules, LocalFilename is tested against - the regexps of these and the callback module corresponding to - the first match is used, or an error tuple is returned if no - matching regexp is found.

- +

Changes configuration for a TFTP daemon, server, or client process.

- + info(daemons) -> [{Pid, Options}] Returns information about all daemons. @@ -342,72 +311,89 @@

Returns information about a TFTP daemon, server, or client process.

- -
- - - change_config(daemons, Options) -> [{Pid, Result}] - Changes configuration for all daemons. - + + + read_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason} + Reads a (virtual) file from a TFTP server. + RemoteFilename = string() + LocalFilename = binary | string() Options = [option()] - Pid = pid() - Result = ok | {error, Reason} + LastCallbackState = term() Reason = term() -

Changes configuration for all TFTP daemon processes.

- - +

Reads a (virtual) file RemoteFilename from a TFTP + server.

+

If LocalFilename is the atom binary, + tftp_binary is used as callback module. It concatenates + all transferred blocks and returns them as one single binary + in LastCallbackState.

+

If LocalFilename is a string and there are no + registered callback modules, tftp_file is used as + callback module. It writes each transferred block to the file + named LocalFilename and returns the number of + transferred bytes in LastCallbackState.

+

If LocalFilename is a string and there are registered + callback modules, LocalFilename is tested against + the regexps of these and the callback module corresponding to + the first match is used, or an error tuple is returned if no + matching regexp is found.

+ +
- + - change_config(servers, Options) -> [{Pid, Result}] - Changes configuration for all servers. - + start(Options) -> {ok, Pid} | {error, Reason} + Starts a daemon process. Options = [option()] Pid = pid() - Result = ok | {error, Reason} Reason = term() -

Changes configuration for all TFTP server processes.

+

Starts a daemon process listening for UDP packets on a + port. When it receives a request for read or write, it spawns + a temporary server process handling the actual transfer + of the (virtual) file.

- +
- change_config(Pid, Options) -> Result - Changes configuration for a TFTP daemon, server, - or client process. + write_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason} + Writes a (virtual) file to a TFTP server. - Pid = pid() + RemoteFilename = string() + LocalFilename = binary() | string() Options = [option()] - Result = ok | {error, Reason} - Reason = term() - - -

Changes configuration for a TFTP daemon, server, or client process.

- - -
-
- - - start() -> ok | {error, Reason} - Starts the Inets application. - + LastCallbackState = term() Reason = term() -

Starts the Inets application.

+

Writes a (virtual) file RemoteFilename to a TFTP + server.

+

If LocalFilename is a binary, tftp_binary is + used as callback module. The binary is transferred block by + block and the number of transferred bytes is returned in + LastCallbackState.

+

If LocalFilename is a string and there are no + registered callback modules, tftp_file is used as + callback module. It reads the file named LocalFilename + block by block and returns the number of transferred bytes + in LastCallbackState.

+

If LocalFilename is a string and there are registered + callback modules, LocalFilename is tested against + the regexps of these and the callback module corresponding to + the first match is used, or an error tuple is returned if no + matching regexp is found.

+
@@ -467,43 +453,32 @@
- - prepare(Peer, Access, Filename, Mode, SuggestedOptions, InitialState) -> {ok, AcceptedOptions, NewState} | {error, {Code, Text}} - Prepares to open a file on the client side. + + Module:abort(Code, Text, State) -> ok + Aborts the file transfer. - Peer = {PeerType, PeerHost, PeerPort} - PeerType = inet | inet6 - PeerHost = ip_address() - PeerPort = integer() - Access = read | write - Filename = string() - Mode = string() - SuggestedOptions = AcceptedOptions = [{Key, Value}] -  Key = Value = string() - InitialState = [] | [{root_dir, string()}] - NewState = term() Code = undef | enoent | eacces | enospc   | badop | eexist | baduser | badopt   | int() Text = string() + State = term() -

Prepares to open a file on the client side.

-

No new options can be added, but those present in - SuggestedOptions can be omitted or replaced with new - values in AcceptedOptions.

-

This is followed by a call to open/4 before any - read/write access is performed. AcceptedOptions is - sent to the server, which replies with the options that it - accepts. These are then forwarded to open/4 as - SuggestedOptions.

- - +

Invoked when the file transfer is aborted.

+

The callback function is expected to clean + up its used resources after the aborted file + transfer, such as closing open file + descriptors and so on. The function is not + invoked if any of the other callback + functions returns an error, as it is + expected that they already have cleaned up + the necessary resources. However, it is + invoked if the functions fail (crash).

- - - open(Peer, Access, Filename, Mode, SuggestedOptions, State) -> {ok, AcceptedOptions, NewState} | {error, {Code, Text}} + + + Module:open(Peer, Access, Filename, Mode, SuggestedOptions, State) -> {ok, AcceptedOptions, NewState} | {error, {Code, Text}} Opens a file for read or write access. Peer = {PeerType, PeerHost, PeerPort} @@ -536,9 +511,44 @@ + + + Module:prepare(Peer, Access, Filename, Mode, SuggestedOptions, InitialState) -> {ok, AcceptedOptions, NewState} | {error, {Code, Text}} + Prepares to open a file on the client side. + + Peer = {PeerType, PeerHost, PeerPort} + PeerType = inet | inet6 + PeerHost = ip_address() + PeerPort = integer() + Access = read | write + Filename = string() + Mode = string() + SuggestedOptions = AcceptedOptions = [{Key, Value}] +  Key = Value = string() + InitialState = [] | [{root_dir, string()}] + NewState = term() + Code = undef | enoent | eacces | enospc +   | badop | eexist | baduser | badopt +   | int() + Text = string() + + +

Prepares to open a file on the client side.

+

No new options can be added, but those present in + SuggestedOptions can be omitted or replaced with new + values in AcceptedOptions.

+

This is followed by a call to open/4 before any + read/write access is performed. AcceptedOptions is + sent to the server, which replies with the options that it + accepts. These are then forwarded to open/4 as + SuggestedOptions.

+ + +
+
- read(State) -> {more, Bin, NewState} | {last, Bin, FileSize} | {error, {Code, Text}} + Module:read(State) -> {more, Bin, NewState} | {last, Bin, FileSize} | {error, {Code, Text}} Reads a chunk from the file. State = NewState = term() @@ -565,7 +575,7 @@ - write(Bin, State) -> {more, NewState} | {last, FileSize} | {error, {Code, Text}} + Module:write(Bin, State) -> {more, NewState} | {last, FileSize} | {error, {Code, Text}} Writes a chunk to the file. Bin = binary() @@ -590,30 +600,6 @@ - - - abort(Code, Text, State) -> ok - Aborts the file transfer. - - Code = undef | enoent | eacces | enospc -   | badop | eexist | baduser | badopt -   | int() - Text = string() - State = term() - - -

Invoked when the file transfer is aborted.

-

The callback function is expected to clean - up its used resources after the aborted file - transfer, such as closing open file - descriptors and so on. The function is not - invoked if any of the other callback - functions returns an error, as it is - expected that they already have cleaned up - the necessary resources. However, it is - invoked if the functions fail (crash).

-
-
@@ -628,7 +614,7 @@ - error_msg(Format, Data) -> ok | exit(Reason) + Logger:error_msg(Format, Data) -> ok | exit(Reason) Logs an error message. Format = string() @@ -644,32 +630,32 @@ - warning_msg(Format, Data) -> ok | exit(Reason) - Logs a warning message. + Logger:info_msg(Format, Data) -> ok | exit(Reason) + Logs an info message. Format = string() Data = [term()] Reason = term() -

Logs a warning message. - See error_logger:warning_msg/2 for details.

- - +

Logs an info message. + See error_logger:info_msg/2 for details.

- + - info_msg(Format, Data) -> ok | exit(Reason) - Logs an info message. + Logger:warning_msg(Format, Data) -> ok | exit(Reason) + Logs a warning message. Format = string() Data = [term()] Reason = term() -

Logs an info message. - See error_logger:info_msg/2 for details.

+

Logs a warning message. + See error_logger:warning_msg/2 for details.

+ +
-- cgit v1.2.3