Lines Matching refs:xparam
283 php_stream_xport_param *xparam; in php_sockop_set_option() local
344 xparam = (php_stream_xport_param *)ptrparam; in php_sockop_set_option()
346 switch (xparam->op) { in php_sockop_set_option()
348 xparam->outputs.returncode = (listen(sock->socket, xparam->inputs.backlog) == 0) ? 0: -1; in php_sockop_set_option()
352 xparam->outputs.returncode = php_network_get_sock_name(sock->socket, in php_sockop_set_option()
353 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_sockop_set_option()
354 xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, in php_sockop_set_option()
355 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_sockop_set_option()
356 xparam->want_addr ? &xparam->outputs.addrlen : NULL in php_sockop_set_option()
361 xparam->outputs.returncode = php_network_get_peer_name(sock->socket, in php_sockop_set_option()
362 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_sockop_set_option()
363 xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, in php_sockop_set_option()
364 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_sockop_set_option()
365 xparam->want_addr ? &xparam->outputs.addrlen : NULL in php_sockop_set_option()
371 if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { in php_sockop_set_option()
374 xparam->outputs.returncode = sock_sendto(sock, in php_sockop_set_option()
375 xparam->inputs.buf, xparam->inputs.buflen, in php_sockop_set_option()
377 xparam->inputs.addr, in php_sockop_set_option()
378 xparam->inputs.addrlen TSRMLS_CC); in php_sockop_set_option()
379 if (xparam->outputs.returncode == -1) { in php_sockop_set_option()
389 if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { in php_sockop_set_option()
392 if ((xparam->inputs.flags & STREAM_PEEK) == STREAM_PEEK) { in php_sockop_set_option()
395 xparam->outputs.returncode = sock_recvfrom(sock, in php_sockop_set_option()
396 xparam->inputs.buf, xparam->inputs.buflen, in php_sockop_set_option()
398 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_sockop_set_option()
399 xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, in php_sockop_set_option()
400 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_sockop_set_option()
401 xparam->want_addr ? &xparam->outputs.addrlen : NULL in php_sockop_set_option()
419 xparam->outputs.returncode = shutdown(sock->socket, shutdown_how[xparam->how]); in php_sockop_set_option()
520 static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr … in parse_unix_address() argument
527 if (xparam->inputs.namelen >= sizeof(unix_addr->sun_path)) { in parse_unix_address()
533 xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1; in parse_unix_address()
539 memcpy(unix_addr->sun_path, xparam->inputs.name, xparam->inputs.namelen); in parse_unix_address()
584 static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno TSRMLS_DC) in parse_ip_address() argument
586 …return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_error… in parse_ip_address()
590 php_stream_xport_param *xparam TSRMLS_DC) in php_tcp_sockop_bind()
602 if (xparam->want_errortext) { in php_tcp_sockop_bind()
603 spprintf(&xparam->outputs.error_text, 0, "Failed to create unix%s socket %s", in php_tcp_sockop_bind()
610 parse_unix_address(xparam, &unix_addr TSRMLS_CC); in php_tcp_sockop_bind()
613 (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen); in php_tcp_sockop_bind()
617 host = parse_ip_address(xparam, &portno TSRMLS_CC); in php_tcp_sockop_bind()
625 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_bind()
637 php_stream_xport_param *xparam TSRMLS_DC) in php_tcp_sockop_connect()
652 if (xparam->want_errortext) { in php_tcp_sockop_connect()
653 spprintf(&xparam->outputs.error_text, 0, "Failed to create unix socket"); in php_tcp_sockop_connect()
658 parse_unix_address(xparam, &unix_addr TSRMLS_CC); in php_tcp_sockop_connect()
661 …ckaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen, in php_tcp_sockop_connect()
662 xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, xparam->inputs.timeout, in php_tcp_sockop_connect()
663 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_connect()
666 xparam->outputs.error_code = err; in php_tcp_sockop_connect()
672 host = parse_ip_address(xparam, &portno TSRMLS_CC); in php_tcp_sockop_connect()
680 if (xparam->want_errortext) { in php_tcp_sockop_connect()
681 spprintf(&xparam->outputs.error_text, 0, "local_addr context option is not a string."); in php_tcp_sockop_connect()
686 …ss_ex(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), &bindport, xparam->want_errortext, &xparam->outp… in php_tcp_sockop_connect()
695 xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, in php_tcp_sockop_connect()
696 xparam->inputs.timeout, in php_tcp_sockop_connect()
697 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_connect()
704 xparam->outputs.error_code = err; in php_tcp_sockop_connect()
717 if (ret >= 0 && xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC && err == EINPROGRESS) { in php_tcp_sockop_connect()
726 php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC) in php_tcp_sockop_accept()
730 xparam->outputs.client = NULL; in php_tcp_sockop_accept()
733 xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, in php_tcp_sockop_accept()
734 xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, in php_tcp_sockop_accept()
735 xparam->want_addr ? &xparam->outputs.addr : NULL, in php_tcp_sockop_accept()
736 xparam->want_addr ? &xparam->outputs.addrlen : NULL, in php_tcp_sockop_accept()
737 xparam->inputs.timeout, in php_tcp_sockop_accept()
738 xparam->want_errortext ? &xparam->outputs.error_text : NULL, in php_tcp_sockop_accept()
739 &xparam->outputs.error_code in php_tcp_sockop_accept()
754 xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+"); in php_tcp_sockop_accept()
755 if (xparam->outputs.client) { in php_tcp_sockop_accept()
756 xparam->outputs.client->context = stream->context; in php_tcp_sockop_accept()
764 return xparam->outputs.client == NULL ? -1 : 0; in php_tcp_sockop_accept()
770 php_stream_xport_param *xparam; in php_tcp_sockop_set_option() local
774 xparam = (php_stream_xport_param *)ptrparam; in php_tcp_sockop_set_option()
776 switch(xparam->op) { in php_tcp_sockop_set_option()
779 xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam TSRMLS_CC); in php_tcp_sockop_set_option()
783 xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam TSRMLS_CC); in php_tcp_sockop_set_option()
788 xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC TSRMLS_CC); in php_tcp_sockop_set_option()