Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gen_udp(3erl) [linux man page]

gen_udp(3erl)						     Erlang Module Definition						     gen_udp(3erl)

NAME
gen_udp - Interface to UDP sockets DESCRIPTION
The gen_udp module provides functions for communicating with sockets using the UDP protocol. DATA TYPES
ip_address() see inet(3erl) posix() see inet(3erl) socket() as returned by open/1,2 EXPORTS
open(Port) -> {ok, Socket} | {error, Reason} open(Port, Options) -> {ok, Socket} | {error, Reason} Types Port = 0..65535 Options = [Opt] Opt -- see below Socket = socket() Reason = posix() Associates a UDP port number ( Port ) with the calling process. The available options are: list : Received Packet is delivered as a list. binary : Received Packet is delivered as a binary. {ip, ip_address()} : If the host has several network interfaces, this option specifies which one to use. {fd, int()} : If a socket has somehow been opened without using gen_udp , use this option to pass the file descriptor for it. inet6 : Set up the socket for IPv6. inet : Set up the socket for IPv4. Opt : See inet:setopts/2 . The returned socket Socket is used to send packets from this port with send/4 . When UDP packets arrive at the opened port, they are delivered as messages: {udp, Socket, IP, InPortNo, Packet} Note that arriving UDP packets that are longer than the receive buffer option specifies, might be truncated without warning. IP and InPortNo define the address from which Packet came. Packet is a list of bytes if the option list was specified. Packet is a binary if the option binary was specified. Default value for the receive buffer option is {recbuf, 8192} . If Port == 0 , the underlying OS assigns a free UDP port, use inet:port/1 to retrieve it. send(Socket, Address, Port, Packet) -> ok | {error, Reason} Types Socket = socket() Address = string() | atom() | ip_address() Port = 0..65535 Packet = [char()] | binary() Reason = not_owner | posix() Sends a packet to the specified address and port. The Address argument can be either a hostname, or an IP address. recv(Socket, Length) -> {ok, {Address, Port, Packet}} | {error, Reason} recv(Socket, Length, Timeout) -> {ok, {Address, Port, Packet}} | {error, Reason} Types Socket = socket() Length = int() Address = ip_address() Port = 0..65535 Packet = [char()] | binary() Timeout = int() | infinity Reason = not_owner | posix() This function receives a packet from a socket in passive mode. The optional Timeout parameter specifies a timeout in milliseconds. The default value is infinity . controlling_process(Socket, Pid) -> ok Types Socket = socket() Pid = pid() Assigns a new controlling process Pid to Socket . The controlling process is the process which receives messages from the socket. close(Socket) -> ok | {error, Reason} Types Socket = socket() Reason = not_owner | posix() Closes a UDP socket. Ericsson AB kernel 2.14.3 gen_udp(3erl)

Check Out this Related Man Page

mod_security(3erl)					     Erlang Module Definition						mod_security(3erl)

NAME
mod_security - Security Audit and Trailing Functionality DESCRIPTION
Security Audit and Trailing Functionality EXPORTS
list_auth_users(Port) -> Users | [] list_auth_users(Address, Port) -> Users | [] list_auth_users(Port, Dir) -> Users | [] list_auth_users(Address, Port, Dir) -> Users | [] Types Port = integer() Address = {A,B,C,D} | string() | undefined Dir = string() Users = list() = [string()] list_auth_users/1 , list_auth_users/2 and list_auth_users/3 returns a list of users that are currently authenticated. Authentica- tions are stored for SecurityAuthTimeout seconds, and are then discarded. list_blocked_users(Port) -> Users | [] list_blocked_users(Address, Port) -> Users | [] list_blocked_users(Port, Dir) -> Users | [] list_blocked_users(Address, Port, Dir) -> Users | [] Types Port = integer() Address = {A,B,C,D} | string() | undefined Dir = string() Users = list() = [string()] list_blocked_users/1 , list_blocked_users/2 and list_blocked_users/3 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} Types 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 blocks the user User from the directory Dir for a specified amount of time. unblock_user(User, Port) -> true | {error, Reason} unblock_user(User, Address, Port) -> true | {error, Reason} unblock_user(User, Port, Dir) -> true | {error, Reason} unblock_user(User, Address, Port, Dir) -> true | {error, Reason} Types User = string() Port = integer() Address = {A,B,C,D} | string() | undefined Dir = string() Reason = term() unblock_user/2 , unblock_user/3 and unblock_user/4 removes the user User from the list of blocked users for the Port (and Dir) spec- ified. THE SECURITYCALLBACKMODULE
The SecurityCallbackModule is a user written module that can receive events from the mod_security Erlang Webserver API module. This module only exports the function(s), event/4,5 , which are described below. EXPORTS
event(What, Port, Dir, Data) -> ignored event(What, Address, Port, Dir, Data) -> ignored Types What = atom() Port = integer() Address = {A,B,C,D} | string() <v>Dir = string() Data = [Info] Info = {Name, Value} event/4 or event/4 is called whenever an event occurs in the mod_security Erlang Webserver API module ( event/4 is called if Address is undefined and event/5 otherwise). The What argument specifies the type of event that has occurred, and should be one of the fol- lowing reasons; auth_fail (a failed user authentication), user_block (a user is being blocked from access) or user_unblock (a user is being removed from the block list). Note: Note that the user_unblock event is not triggered when a user is removed from the block list explicitly using the unblock_user function. Ericsson AB inets 5.5.2 mod_security(3erl)
Man Page