Lines Matching refs:xparam
305 php_stream_xport_param *xparam; in php_sockop_set_option() local
370 xparam = (php_stream_xport_param *)ptrparam; in php_sockop_set_option()
372 switch (xparam->op) { in php_sockop_set_option()
374 xparam->outputs.returncode = (listen(sock->socket, xparam->inputs.backlog) == 0) ? 0: -1; in php_sockop_set_option()
378 xparam->outputs.returncode = php_network_get_sock_name(sock->socket, in php_sockop_set_option()
379 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_sockop_set_option()
380 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_sockop_set_option()
381 xparam->want_addr ? &xparam->outputs.addrlen : NULL in php_sockop_set_option()
386 xparam->outputs.returncode = php_network_get_peer_name(sock->socket, in php_sockop_set_option()
387 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_sockop_set_option()
388 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_sockop_set_option()
389 xparam->want_addr ? &xparam->outputs.addrlen : NULL in php_sockop_set_option()
395 if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { in php_sockop_set_option()
398 xparam->outputs.returncode = sock_sendto(sock, in php_sockop_set_option()
399 xparam->inputs.buf, xparam->inputs.buflen, in php_sockop_set_option()
401 xparam->inputs.addr, in php_sockop_set_option()
402 xparam->inputs.addrlen); in php_sockop_set_option()
403 if (xparam->outputs.returncode == -1) { in php_sockop_set_option()
413 if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { in php_sockop_set_option()
416 if ((xparam->inputs.flags & STREAM_PEEK) == STREAM_PEEK) { in php_sockop_set_option()
419 xparam->outputs.returncode = sock_recvfrom(sock, in php_sockop_set_option()
420 xparam->inputs.buf, xparam->inputs.buflen, in php_sockop_set_option()
422 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_sockop_set_option()
423 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_sockop_set_option()
424 xparam->want_addr ? &xparam->outputs.addrlen : NULL in php_sockop_set_option()
442 xparam->outputs.returncode = shutdown(sock->socket, shutdown_how[xparam->how]); in php_sockop_set_option()
547 static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr) in parse_unix_address() argument
554 if (xparam->inputs.namelen >= sizeof(unix_addr->sun_path)) { in parse_unix_address()
560 xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1; in parse_unix_address()
566 memcpy(unix_addr->sun_path, xparam->inputs.name, xparam->inputs.namelen); in parse_unix_address()
611 static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno) in parse_ip_address() argument
613 …return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_error… in parse_ip_address()
617 php_stream_xport_param *xparam) in php_tcp_sockop_bind() argument
631 if (xparam->want_errortext) { in php_tcp_sockop_bind()
632 xparam->outputs.error_text = strpprintf(0, "Failed to create unix%s socket %s", in php_tcp_sockop_bind()
639 parse_unix_address(xparam, &unix_addr); in php_tcp_sockop_bind()
642 (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen); in php_tcp_sockop_bind()
646 host = parse_ip_address(xparam, &portno); in php_tcp_sockop_bind()
684 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_bind()
696 php_stream_xport_param *xparam) in php_tcp_sockop_connect() argument
712 if (xparam->want_errortext) { in php_tcp_sockop_connect()
713 xparam->outputs.error_text = strpprintf(0, "Failed to create unix socket"); in php_tcp_sockop_connect()
718 parse_unix_address(xparam, &unix_addr); in php_tcp_sockop_connect()
721 …ckaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen, in php_tcp_sockop_connect()
722 xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, xparam->inputs.timeout, in php_tcp_sockop_connect()
723 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_connect()
726 xparam->outputs.error_code = err; in php_tcp_sockop_connect()
732 host = parse_ip_address(xparam, &portno); in php_tcp_sockop_connect()
740 if (xparam->want_errortext) { in php_tcp_sockop_connect()
741 xparam->outputs.error_text = strpprintf(0, "local_addr context option is not a string."); in php_tcp_sockop_connect()
746 …ress_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outp… in php_tcp_sockop_connect()
777 xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, in php_tcp_sockop_connect()
778 xparam->inputs.timeout, in php_tcp_sockop_connect()
779 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_connect()
787 xparam->outputs.error_code = err; in php_tcp_sockop_connect()
800 if (ret >= 0 && xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC && err == EINPROGRESS) { in php_tcp_sockop_connect()
809 php_stream_xport_param *xparam STREAMS_DC) in php_tcp_sockop_accept()
815 xparam->outputs.client = NULL; in php_tcp_sockop_accept()
824 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_tcp_sockop_accept()
825 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_tcp_sockop_accept()
826 xparam->want_addr ? &xparam->outputs.addrlen : NULL, in php_tcp_sockop_accept()
827 xparam->inputs.timeout, in php_tcp_sockop_accept()
828 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_accept()
829 &xparam->outputs.error_code, in php_tcp_sockop_accept()
838 xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+"); in php_tcp_sockop_accept()
839 if (xparam->outputs.client) { in php_tcp_sockop_accept()
840 xparam->outputs.client->ctx = stream->ctx; in php_tcp_sockop_accept()
847 return xparam->outputs.client == NULL ? -1 : 0; in php_tcp_sockop_accept()
853 php_stream_xport_param *xparam; in php_tcp_sockop_set_option() local
857 xparam = (php_stream_xport_param *)ptrparam; in php_tcp_sockop_set_option()
859 switch(xparam->op) { in php_tcp_sockop_set_option()
862 xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam); in php_tcp_sockop_set_option()
866 xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam); in php_tcp_sockop_set_option()
871 xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC); in php_tcp_sockop_set_option()