-
eunet_get_errormode ()
-
eunet_set_errormode (integer)
Params:
-
eunet_get_error ()
Return:
returns a 2-element sequence {ERROR_CODE,ERROR_STRING}
-
eunet_get_blocksize ()
-
eunet_delay (atom)
Delays nicely for a set number of milliseconds (or a few more)
Params:
Return:
Returns 0 on success or something else on error.
-
eunet_get_iface_list ()
Get list of networking interfaces
-
eunet_get_iface_details (sequence)
Get networking interface details
Params:
Return:
returns a sequence of details as:
{seq InterfaceName, int index, int flags, seq MACaddr, int metric, int mtu, int serial_outfill,
int serial_keepalive, seq if_map, int tx_Q_len, seq IP_addr, seq PPP_Dest_IP_addr,
seq IP_Bcast_addr, seq IP_Netmask, seq stats}
Note: if PPP_Dest_IP_addr = IP_addr, serial_keepalive will be the up/down status of the address
-
eunet_bind (atom, sequence)
Params:
-
atom socket
-
sequence inet_addr
Description:
Bind is typically used in TCP and SOCK_STREAM connections.
Return:
It returns 0 on success and -1 on failure.
-
eunet_listen (atom, integer)
Params:
-
atom socket
-
integer pending_conn_len
Description:
Listen is typically used in TCP and SOCK_STREAM connections.
Return:
It returns 0 on success and error_code on failure.
-
eunet_accept (atom)
Params:
Return:
Returns {atom new_socket, sequence peer_ip_addres} on success, or
-1 on error.
-
eunet_connect (atom, sequence)
Params:
-
atom socket
-
sequence inet_addr
Return:
Returns 0 on success and -1 on failure
-
eunet_new_socket (integer, integer, integer)
Params:
-
integer family
-
integer sock_type
-
integer protocol
-
eunet_close_socket (atom)
Close socket
Params:
-
eunet_shutdown_socket (atom, atom)
Shutdown socket
Params:
-
eunet_poll (sequence, atom)
Params:
-
sequence socket_list
Sequence of 2-element sequences. Each sequence contains the socket number,
and the flags of what to check for.
-
atom timeout
Number of milliseconds before returning. 0 returns immediately, -1 returns
only when an event occurs
Description:
select() is not supported
Return:
eunet_poll may return an atom on no event or error, and a sequence of
return event flags (matching socket_list) when an event has occurred.
-
eunet_send (atom, sequence, atom)
Params:
-
atom socket
-
sequence data
-
atom flags
Return:
Returns the # of chars sent, or -1 for error
-
eunet_sendto (atom, sequence, atom, sequence)
Params:
-
atom socket
-
sequence data
-
atom flags
-
sequence inet_addr
Return:
Returns the # of chars sent, or -1 for error
-
eunet_recv (atom, atom)
Params:
Description:
The flag MSG_DONTWAIT is a Linux-only extension, and should not be used
in cross-platform applications.
From the Linux Man page on recv:
The MSG_DONTWAIT flag requests the call to return when it would block otherwise.
If no data is available, errno is set to EAGAIN. This flag is not available in
strict ANSI or C99 compilation mode.
Return:
Returns either a sequence of data, or a 2-element sequence {ERROR_CODE,ERROR_STRING}.
-
eunet_recvfrom (atom, atom)
Params:
-
eunet_get_socket_options (atom, integer, integer)
Params:
-
atom socket
-
integer level
-
integer optname
Return:
Get_socket_options returns an OBJECT containing the option value, or {"ERROR",errcode} on error.
-
eunet_set_socket_options (atom, integer, integer, object)
Params:
-
atom socket
-
integer level
-
integer optname
-
object val
Return:
Set_socket_options returns 0 on success and -1 on error.
-
eunet_dnsquery (sequence, integer, atom)
Params:
-
sequence dname
-
integer q_type
-
atom options
Description:
At present, only A,MX,and NS queries are supported.
Return:
Returns a set of sequences of {ip_addr, q_type, order} resolving the IP address for
the given domain name and/or host.
Error 9501 = No record found
-
eunet_getmxrr (sequence, atom)
Params:
-
sequence dname
-
atom options
Description:
Error 9003 = MS: RCODE_NAME_ERROR - Something's there, but it's not exact.
Error 9501 = No Data Found
-
eunet_getnsrr (sequence, atom)
Params:
-
sequence dname
-
atom options
-
eunet_gethostbyname (sequence)
Params:
Description:
Deprecated - replaced by GetAddrInfo
-
eunet_getservbyname (sequence)
Params:
Description:
Deprecated - replaced by GetAddrInfo
-
eunet_getaddrinfo (object, object, object)
Params:
-
object node
Host (node) name or a numeric host address string. For the Internet protocol, the numeric host address string is a dotted-decimal IPv4 address or an IPv6 hex address.
-
object service
Either a service name or port number represented as a string.
-
object hints
Hints about the type of socket the caller supports.
Return:
Returns a sequence of sequences {atom flags, atom family, atom socktype, atom protocol, sequence inet_addr}
on success or an error code on failure
-
eunet_get_addrinfo (object, object, object)
Params:
-
object node
-
object service
-
object hints
-
eunet_urlencode (sequence)
Params:
Description:
HTML form data is usually URL-encoded to package it in a GET or POST submission. In a nutshell, here's how you URL-encode the name-value pairs of the form data:
1. Convert all "unsafe" characters in the names and values to "%xx", where "xx" is the ascii value of the character, in hex. "Unsafe" characters include =, &, %, +, non-printable characters, and any others you want to encode-- there's no danger in encoding too many characters. For simplicity, you might encode all non-alphanumeric characters.
2. Change all spaces to plusses.
3. String the names and values together with = and &, like
name1=value1&name2=value2&name3=value3
4. This string is your message body for POST submissions, or the query string for GET submissions.
For example, if a form has a field called "name" that's set to "Lucy", and a field called "neighbors" that's set to "Fred & Ethel", the URL-encoded form data would be
name=Lucy&neighbors=Fred+%26+Ethel <<== note no \n or \r
with a length of 34.
-
eunet_get_sendheader (object)
Params:
Return:
if field is 0, return the whole sequence.
if field is 1..length(sendheader), return just that field
if field is invalid, return -1.
if field is a sequence, try to match it to sendheader[x][1].
-
eunet_parse_httpheader (sequence)
Params:
Description:
---*** THIS FUNCTION IS DEPRECATED IN VERSION 1.3.1 ***---
-
eunet_get_recvheader (object)
Params:
Description:
recvheader was parsed out previously in eunet_parse_recvheader()
Return:
if field is 0, return the whole sequence.
if field is 1..length(recvheader), return just that field
if field is invalid, return -1.
if field is a sequence, try to match it to recvheader[x][1].
we'll NOT return a {"Name","value"} format
because that leads to using a junk seq to get the [2] from
--> And yet, that's exactly what we're doing. -- Mike.
-
eunet_get_http (sequence, sequence, sequence)
Params:
-
sequence inet_addr
-
sequence hostname
-
sequence file
Return:
Returns a 2-element sequence of {sequence headerdata, sequence of data bytes}
-
eunet_get_http_use_cookie (sequence, sequence, sequence)
Params:
-
sequence inet_addr
-
sequence hostname
-
sequence file
-
eunet_get_url (sequence)
Params:
-
eunet_get_sock_name (integer)
Params:
-
eunet_get_peer_name (integer)
Params:
-
eunet_get_port (atom)
get the port that is bound to the socket
Params:
Description:
low-level command
Return:
integer: port number
Example:
port_used = eunet_get_port(tcpSocket)