mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
isc_socket_create() API update
This commit is contained in:
@@ -117,7 +117,8 @@ ns_interface_create(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr,
|
|||||||
* Open a UDP socket.
|
* Open a UDP socket.
|
||||||
*/
|
*/
|
||||||
ifp->udpsocket = NULL;
|
ifp->udpsocket = NULL;
|
||||||
iresult = isc_socket_create(mgr->socketmgr, isc_sockettype_udp,
|
iresult = isc_socket_create(mgr->socketmgr, PF_INET,
|
||||||
|
isc_sockettype_udp,
|
||||||
&ifp->udpsocket);
|
&ifp->udpsocket);
|
||||||
if (iresult != ISC_R_SUCCESS) {
|
if (iresult != ISC_R_SUCCESS) {
|
||||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||||
@@ -147,7 +148,8 @@ ns_interface_create(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr,
|
|||||||
* Open a TCP socket.
|
* Open a TCP socket.
|
||||||
*/
|
*/
|
||||||
ifp->tcpsocket = NULL;
|
ifp->tcpsocket = NULL;
|
||||||
iresult = isc_socket_create(mgr->socketmgr, isc_sockettype_tcp,
|
iresult = isc_socket_create(mgr->socketmgr, PF_INET,
|
||||||
|
isc_sockettype_tcp,
|
||||||
&ifp->tcpsocket);
|
&ifp->tcpsocket);
|
||||||
if (iresult != ISC_R_SUCCESS) {
|
if (iresult != ISC_R_SUCCESS) {
|
||||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||||
|
@@ -384,7 +384,8 @@ main(int argc, char *argv[])
|
|||||||
sockaddr.type.sin.sin_family = AF_INET;
|
sockaddr.type.sin.sin_family = AF_INET;
|
||||||
sockaddr.type.sin.sin_port = htons(5555);
|
sockaddr.type.sin.sin_port = htons(5555);
|
||||||
sockaddr.length = sizeof (struct sockaddr_in);
|
sockaddr.length = sizeof (struct sockaddr_in);
|
||||||
RUNTIME_CHECK(isc_socket_create(socketmgr, isc_sockettype_tcp, &s0) ==
|
RUNTIME_CHECK(isc_socket_create(socketmgr, PF_INET,
|
||||||
|
isc_sockettype_tcp, &s0) ==
|
||||||
ISC_R_SUCCESS);
|
ISC_R_SUCCESS);
|
||||||
RUNTIME_CHECK(isc_socket_bind(s0, &sockaddr) == ISC_R_SUCCESS);
|
RUNTIME_CHECK(isc_socket_bind(s0, &sockaddr) == ISC_R_SUCCESS);
|
||||||
RUNTIME_CHECK(isc_socket_listen(s0, 0) == ISC_R_SUCCESS);
|
RUNTIME_CHECK(isc_socket_listen(s0, 0) == ISC_R_SUCCESS);
|
||||||
|
@@ -354,7 +354,8 @@ main(int argc, char *argv[])
|
|||||||
sockaddr.type.sin.sin_family = AF_INET;
|
sockaddr.type.sin.sin_family = AF_INET;
|
||||||
sockaddr.type.sin.sin_port = htons(5555);
|
sockaddr.type.sin.sin_port = htons(5555);
|
||||||
sockaddr.length = sizeof (struct sockaddr_in);
|
sockaddr.length = sizeof (struct sockaddr_in);
|
||||||
RUNTIME_CHECK(isc_socket_create(socketmgr, isc_sockettype_udp, &s0) ==
|
RUNTIME_CHECK(isc_socket_create(socketmgr, PF_INET,
|
||||||
|
isc_sockettype_udp, &s0) ==
|
||||||
ISC_R_SUCCESS);
|
ISC_R_SUCCESS);
|
||||||
RUNTIME_CHECK(isc_socket_bind(s0, &sockaddr) == ISC_R_SUCCESS);
|
RUNTIME_CHECK(isc_socket_bind(s0, &sockaddr) == ISC_R_SUCCESS);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user