Lines Matching defs:dev
298 isc_socketevent_t *dev; /* send()/recv() done event */
362 static isc_boolean_t senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev);
363 static isc_boolean_t acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev);
364 static isc_boolean_t connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev);
365 static void send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev);
366 static void send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev);
371 static void queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev);
959 build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
972 memmove(&msg->to_addr, &dev->address.type, dev->address.length);
973 msg->to_addr_len = dev->address.length;
975 buffer = ISC_LIST_HEAD(dev->bufferlist);
983 write_count = dev->region.length - dev->n;
994 memmove(cpbuffer->buf,(dev->region.base + dev->n), write_count);
1009 skip_count = dev->n;
1056 isc_socketevent_t *dev)
1060 dev->address = *address;
1062 dev->address = sock->address;
1065 dev->address = sock->address;
1228 fill_recv(isc_socket_t *sock, isc_socketevent_t *dev) {
1233 INSIST(dev->n < dev->minimum);
1238 dev->address.length = sock->recvbuf.from_addr_len;
1239 memmove(&dev->address.type, &sock->recvbuf.from_addr,
1241 if (isc_sockaddr_getport(&dev->address) == 0) {
1243 socket_log(__LINE__, sock, &dev->address, IOEVENT,
1252 dev->address = sock->address;
1260 buffer = ISC_LIST_HEAD(dev->bufferlist);
1273 dev->n += copylen;
1278 copylen = min(dev->region.length - dev->n, sock->recvbuf.remaining);
1279 memmove(dev->region.base + dev->n,
1283 dev->n += copylen;
1303 isc_socketevent_t *dev;
1313 dev = ISC_LIST_HEAD(sock->recv_list);
1319 fill_recv(sock, dev);
1324 if (dev->n >= dev->minimum) {
1325 dev->result = ISC_R_SUCCESS;
1326 send_recvdone_event(sock, &dev);
1333 * DOIO_SUCCESS The operation succeeded. dev->result contains
1337 * dev->result contains the appropriate error.
1345 completeio_send(isc_socket_t *sock, isc_socketevent_t *dev,
1354 return (map_socket_error(sock, send_errno, &dev->result,
1361 dev->n += cc;
1369 dev->result = ISC_R_SUCCESS;
1374 startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes,
1388 lpo->dev = dev;
1393 build_msghdr_send(sock, dev, mh, cmsg, sock->iov, lpo);
1427 dev->result = ISC_R_SUCCESS;
1525 isc_socketevent_t *dev;
1534 dev = ISC_LIST_HEAD(sock->send_list);
1536 while (dev != NULL) {
1538 dev = ISC_LIST_NEXT(dev, ev_link);
1945 send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev) {
1948 task = (*dev)->ev_sender;
1949 (*dev)->ev_sender = sock;
1951 if (ISC_LINK_LINKED(*dev, ev_link))
1952 ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link);
1954 if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
1956 isc_task_sendanddetach(&task, (isc_event_t **)dev);
1958 isc_task_send(task, (isc_event_t **)dev);
1967 send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev) {
1970 INSIST(dev != NULL && *dev != NULL);
1972 task = (*dev)->ev_sender;
1973 (*dev)->ev_sender = sock;
1975 if (ISC_LINK_LINKED(*dev, ev_link))
1976 ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link);
1978 if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
1980 isc_task_sendanddetach(&task, (isc_event_t **)dev);
1982 isc_task_send(task, (isc_event_t **)dev);
2231 isc_socketevent_t *dev;
2234 dev = ISC_LIST_HEAD(sock->recv_list);
2235 dev->result = result;
2236 send_recvdone_event(sock, &dev);
2245 isc_socket_connev_t *dev;
2248 dev = ISC_LIST_HEAD(sock->connect_list);
2249 dev->result = result;
2250 send_connectdone_event(sock, &dev);
2314 internal_send(isc_socket_t *sock, isc_socketevent_t *dev,
2329 "internal_send: task got socket event %p", dev);
2350 if (!senddone_is_active(sock, dev))
2356 switch (completeio_send(sock, dev, messagehdr, nbytes, send_errno)) {
2361 send_senddone_event(sock, &dev);
2374 senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev)
2379 while (ldev != NULL && ldev != dev)
2386 acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev)
2391 while (ldev != NULL && ldev != dev)
2398 connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev)
2403 while (cdev != NULL && cdev != dev)
2560 if (senddone_is_active(sock, lpo->dev)) {
2561 lpo->dev->result = isc_result;
2564 send_senddone_event(sock, &lpo->dev);
2628 internal_send(sock, lpo->dev, messagehdr, nbytes, errstatus, lpo);
2795 queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev)
2800 dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
2805 INSIST(!ISC_LINK_LINKED(dev, ev_link));
2806 ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link);
2810 dev, ntask);
2821 socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
2826 dev->ev_sender = task;
2837 queue_receive_event(sock, task, dev);
2857 isc_socketevent_t *dev;
2888 dev = allocate_socketevent(manager->mctx, sock,
2890 if (dev == NULL) {
2899 dev->minimum = 1;
2902 dev->minimum = iocount;
2904 dev->minimum = minimum;
2913 ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
2917 ret = socket_recv(sock, dev, task, 0);
2928 isc_socketevent_t *dev;
2950 dev = allocate_socketevent(manager->mctx, sock,
2952 if (dev == NULL) {
2957 ret = isc_socket_recv2(sock, region, minimum, task, dev, 0);
3010 socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
3020 dev->ev_sender = task;
3022 set_dev_address(address, sock, dev);
3029 dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
3030 dev->pktinfo = *pktinfo;
3035 dev->pktinfo.ipi6_ifindex = 0;
3038 io_state = startio_send(sock, dev, &cc, &send_errno);
3049 dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
3054 INSIST(!ISC_LINK_LINKED(dev, ev_link));
3055 ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link);
3059 dev, ntask);
3089 isc_socketevent_t *dev;
3115 dev = allocate_socketevent(manager->mctx, sock,
3117 if (dev == NULL) {
3121 dev->region = *region;
3123 ret = socket_send(sock, dev, task, address, pktinfo, 0);
3151 isc_socketevent_t *dev;
3180 dev = allocate_socketevent(manager->mctx, sock,
3182 if (dev == NULL) {
3193 ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
3197 ret = socket_send(sock, dev, task, address, pktinfo, flags);
3743 isc_socketevent_t *dev;
3747 dev = ISC_LIST_HEAD(sock->recv_list);
3748 while (dev != NULL) {
3749 current_task = dev->ev_sender;
3750 next = ISC_LIST_NEXT(dev, ev_link);
3752 dev->result = ISC_R_CANCELED;
3753 send_recvdone_event(sock, &dev);
3755 dev = next;
3761 isc_socketevent_t *dev;
3765 dev = ISC_LIST_HEAD(sock->send_list);
3767 while (dev != NULL) {
3768 current_task = dev->ev_sender;
3769 next = ISC_LIST_NEXT(dev, ev_link);
3771 dev->result = ISC_R_CANCELED;
3772 send_senddone_event(sock, &dev);
3774 dev = next;
3781 isc_socket_newconnev_t *dev;
3785 dev = ISC_LIST_HEAD(sock->accept_list);
3786 while (dev != NULL) {
3787 current_task = dev->ev_sender;
3788 next = ISC_LIST_NEXT(dev, ev_link);
3792 dev->newsocket->references--;
3793 closesocket(dev->newsocket->fd);
3794 dev->newsocket->fd = INVALID_SOCKET;
3795 free_socket(&dev->newsocket, __LINE__);
3797 dev->result = ISC_R_CANCELED;
3798 send_acceptdone_event(sock, &dev);
3801 dev = next;
3808 isc_socket_connev_t *dev;
3814 dev = ISC_LIST_HEAD(sock->connect_list);
3816 while (dev != NULL) {
3817 current_task = dev->ev_sender;
3818 next = ISC_LIST_NEXT(dev, ev_link);
3820 dev->result = ISC_R_CANCELED;
3821 send_connectdone_event(sock, &dev);
3823 dev = next;