2015-11-13 14:16:08 +02:00
.TH SXLINK_MASTER_ACCEPT 3 "20 July 2015" "SXMP" "SXMP Library Manual"
2015-08-04 20:39:37 +03:00
.SH NAME
2015-11-13 14:16:08 +02:00
sxlink_master_accept \- Create a new link on already accept TCP connection on the master side.
2015-08-04 20:39:37 +03:00
.br
2015-11-13 14:16:08 +02:00
sxlink_connect \- Create link to the master.
2015-08-04 20:39:37 +03:00
.br
2015-11-13 14:16:08 +02:00
sxlink_close \- Close link.
2015-08-04 20:39:37 +03:00
.SH SYNOPSIS
2015-10-27 00:20:44 +02:00
.B #include <sxmp/sxmp.h>
2015-08-04 20:39:37 +03:00
.sp
2015-11-13 14:16:08 +02:00
sxlink_t *sxlink_master_accept(sxhub_t *ssys, int sck, struct in_addr *addr);
2015-08-04 20:39:37 +03:00
2015-11-13 14:16:08 +02:00
sxlink_t *sxlink_connect(sxhub_t *ssys, const char *host,
int port, const char *SSL_cert, const char *login,
const char *passwd);
2015-08-04 20:39:37 +03:00
2015-11-13 14:16:08 +02:00
int sxlink_close(sxlink_t *co);
2015-08-04 20:39:37 +03:00
.br
.sp
.SH DESCRIPTION
2015-11-13 14:16:08 +02:00
.B sxlink_master_accept
will create a new link within
2015-08-04 20:39:37 +03:00
.B ssys
2015-11-13 14:16:08 +02:00
hub with already accepted socket fd
2015-08-04 20:39:37 +03:00
.B sck
and set ip address of this connection pointed by
.B addr.
If
.B addr
is NULL, peer address will not set.
.br
2015-11-13 14:16:08 +02:00
.B sxlink_connect
will create a new link to the master side using
2015-08-04 20:39:37 +03:00
.B ssys
2015-11-13 14:16:08 +02:00
hub to the host pointed via hostname or ip address in nul terminated string
2015-08-04 20:39:37 +03:00
.B host
running on port number
.B port
and send a X.509 certificate located on pathname pointed by
.B SSL_cert
trying to authorizated with username pointed by
.B login
and password pointed by
.B passwd
.br
2015-11-13 14:16:08 +02:00
.B sxlink_close
will close link pointed by
2015-08-04 20:39:37 +03:00
.B co
destroying all allocated structures, including connection link itself.
.br
.SH RETURN VALUE
Upon successful completion, the functions
2015-11-13 14:16:08 +02:00
.B sxlink_master_accept
2015-08-04 20:39:37 +03:00
and
2015-11-13 14:16:08 +02:00
.B sxlink_connect
will return a valid pointer to the newly created link. Otherwise NULL will be returned and
2015-08-04 20:39:37 +03:00
.B errno will be set with appropriate error.
2015-11-13 14:16:08 +02:00
.B sxlink_close
2015-08-04 20:39:37 +03:00
will return
2015-11-13 14:16:08 +02:00
.B SXE_SUCCESS
2015-08-04 20:39:37 +03:00
on successful case, otherwise it will return an error described below.
.SH ERRORS
2015-11-13 14:16:08 +02:00
.B SXE_FAILED
2015-08-04 20:39:37 +03:00
will be returned in case of bad params given.
.br
2015-11-13 14:16:08 +02:00
.B SXE_ENOMEM
2015-08-04 20:39:37 +03:00
will be returned if there are no memory available.
.br
2015-11-13 14:16:08 +02:00
.B SXE_BADPROTO
2015-08-04 20:39:37 +03:00
will be returned if other side has an invalid protocol.
2015-11-13 14:16:08 +02:00
.B SXE_EPERM
2015-08-04 20:39:37 +03:00
will be returned if permission was denied.
.br
2015-11-13 14:16:08 +02:00
.B SXE_LINKERROR
2015-08-04 20:39:37 +03:00
or
2015-11-13 14:16:08 +02:00
.B SXE_LINKBROKEN
2015-08-04 20:39:37 +03:00
will be returned if connection link is broken i.e. SSL read or write was failed due to the broken TCP connection.
.br
.SH BUGS
Not known yet.
.SH EXAMPLE
None.
.SH APPLICATION USAGE
None.
.SH RATIONALE
Using connection_link on master side with initialized connections set for master functionality will cause memory leaks, use different connections set structure if you need this functionality on the masters side.
.SH SEE ALSO
2015-10-27 00:20:44 +02:00
.BI sxhub_setsslserts(3)
2015-08-04 20:39:37 +03:00
,
2015-10-27 00:20:44 +02:00
.BI sxhub_create(3)
2015-08-04 20:39:37 +03:00
,
2015-10-27 00:20:44 +02:00
.BI sxhub_destroy(3)
2015-08-04 20:39:37 +03:00
,
2015-10-27 00:20:44 +02:00
.BI sxmp_init(3)
2015-08-04 20:39:37 +03:00
.SH COPYRIGHT
2015-12-29 22:42:52 +02:00
This software licensed under GNU LGPL v3. See COPYING for further details.
2015-08-04 20:39:37 +03:00
.br
(c) Askele Group 2013-2015 <http://askele.com>
.SH AUTHOR
Alexander Vdolainen (vdo@askele.com)