]> granicus.if.org Git - php/commit
Wrap recvmsg() and sendmsg()
authorGustavo Lopes <glopes@nebm.ist.utl.pt>
Thu, 1 Nov 2012 19:38:42 +0000 (20:38 +0100)
committerGustavo Lopes <glopes@nebm.ist.utl.pt>
Sat, 2 Feb 2013 15:38:05 +0000 (16:38 +0100)
commit5e51c851431189677aa80f7a3a863699488678cd
treeb98fb2a402a9a4cda1fdda646b2653544fcef27c
parentac47448abb477be99963f0b38fe82ffe78c21a8b
Wrap recvmsg() and sendmsg()

This introduces two new functions:

int socket_recvmsg(resource $socket, array &$msghdr, int $flags)
int socket_sendmsg(resource $socket, array $msghdr, int $flags)

The arrays representing struct msghdr follow the native counterpart
closely: structs are mapped to arrays, fields to array elements whose
key is the name of the field without the prefix (e.g. "name" instead
of "msg_name") and array are mapped to sequential numeric PHP arrays.

Right now the only type of ancillary data supported is fot the
level/type pair IPPROTO_IPV6/IPV6_PKTINFO.

I also refactored out the name resolution functions and made
sockets_strerror() a global function.
ext/sockets/config.m4
ext/sockets/php_sockets.h
ext/sockets/sendrecvmsg.c [new file with mode: 0644]
ext/sockets/sendrecvmsg.h [new file with mode: 0644]
ext/sockets/sockaddr_conv.c [new file with mode: 0644]
ext/sockets/sockaddr_conv.h [new file with mode: 0644]
ext/sockets/sockets.c