X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcnet.h;h=c4a1f045d4d9e2cda364dd07db0f07cf657851fb;hp=30edce4e3e0b1572ce47d3ae978ff75cbc07b03e;hb=9905799a86c606304fd7df2cd401de1740a272a1;hpb=f3b43606c546a86a43b283b46464972296e1e271 diff --git a/lib/silcutil/silcnet.h b/lib/silcutil/silcnet.h index 30edce4e..c4a1f045 100644 --- a/lib/silcutil/silcnet.h +++ b/lib/silcutil/silcnet.h @@ -313,7 +313,8 @@ int silc_net_udp_send(SilcStream stream, * * DESCRIPTION * - * Closes the connection by closing the socket connection. + * Closes the connection by closing the socket connection. This routine + * can only be used with POSIX compliant systems. * ***/ void silc_net_close_connection(int sock); @@ -326,24 +327,13 @@ void silc_net_close_connection(int sock); * * DESCRIPTION * - * Accepts a connection from a particular socket. + * Accepts a connection from a particular socket. This routine can only + * be used with POSIX compliant systems. This call is equivalent to + * accept(2). * ***/ int silc_net_accept_connection(int sock); -/****f* silcutil/SilcNetAPI/silc_net_set_socket_nonblock - * - * SYNOPSIS - * - * int silc_net_set_socket_nonblock(int sock); - * - * DESCRIPTION - * - * Sets the socket to non-blocking mode. - * - ***/ -int silc_net_set_socket_nonblock(int sock); - /****f* silcutil/SilcNetAPI/silc_net_set_socket_opt * * SYNOPSIS @@ -354,7 +344,8 @@ int silc_net_set_socket_nonblock(int sock); * * Sets a option for a socket. This function can be used to set * various options for the socket. Some of the options might be - * system specific. + * system specific. This routine can only be used with POSIX compliant + * systems. This call is equivalent to setsockopt(2); * ***/ int silc_net_set_socket_opt(int sock, int level, int option, int on); @@ -368,12 +359,27 @@ int silc_net_set_socket_opt(int sock, int level, int option, int on); * * DESCRIPTION * - * Return socket options to the `optval' and `opt_len'. + * Return socket options to the `optval' and `opt_len'. This routine + * can only be used with POSIX compliant systems. This call is + * equivalent to getsockopt(2). * ***/ int silc_net_get_socket_opt(int sock, int level, int option, void *optval, int *opt_len); +/****f* silcutil/SilcNetAPI/silc_net_set_socket_nonblock + * + * SYNOPSIS + * + * int silc_net_set_socket_nonblock(SilcSocket sock); + * + * DESCRIPTION + * + * Sets the socket `sock' to non-blocking mode. + * + ***/ +int silc_net_set_socket_nonblock(SilcSocket sock); + /****f* silcutil/SilcNetAPI/silc_net_is_ip4 * * SYNOPSIS @@ -539,7 +545,7 @@ void silc_net_gethostbyaddr_async(const char *addr, * * SYNOPSIS * - * SilcBool silc_net_check_host_by_sock(int sock, char **hostname, + * SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname, * char **ip); * * DESCRIPTION @@ -548,13 +554,14 @@ void silc_net_gethostbyaddr_async(const char *addr, * lookup as well to verify that the IP has FQDN. * ***/ -SilcBool silc_net_check_host_by_sock(int sock, char **hostname, char **ip); +SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname, + char **ip); /****f* silcutil/SilcNetAPI/silc_net_check_local_by_sock * * SYNOPSIS * - * SilcBool silc_net_check_local_by_sock(int sock, char **hostname, + * SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname, * char **ip); * * DESCRIPTION @@ -563,33 +570,34 @@ SilcBool silc_net_check_host_by_sock(int sock, char **hostname, char **ip); * lookup as well to verify that the IP has FQDN. * ***/ -SilcBool silc_net_check_local_by_sock(int sock, char **hostname, char **ip); +SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname, + char **ip); /****f* silcutil/SilcNetAPI/silc_net_get_remote_port * * SYNOPSIS * - * SilcUInt16 silc_net_get_remote_port(int sock); + * SilcUInt16 silc_net_get_remote_port(SilcSocket sock); * * DESCRIPTION * * Return remote port by socket. * ***/ -SilcUInt16 silc_net_get_remote_port(int sock); +SilcUInt16 silc_net_get_remote_port(SilcSocket sock); /****f* silcutil/SilcNetAPI/silc_net_get_local_port * * SYNOPSIS * - * SilcUInt16 silc_net_get_local_port(int sock); + * SilcUInt16 silc_net_get_local_port(SilcSocket sock); * * DESCRIPTION * * Return local port by socket. * ***/ -SilcUInt16 silc_net_get_local_port(int sock); +SilcUInt16 silc_net_get_local_port(SilcSocket sock); /****f* silcutil/SilcNetAPI/silc_net_localhost *