Lines Matching defs:dev
158 * If this macro is defined, enable workaround for a Solaris /dev/poll kernel
749 * Canceling read or write polling via /dev/poll is tricky. Since it
1030 process_cmsg(isc_socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
1043 * msg and dev are used only when ISC_NET_BSD44MSGHDR is defined.
1049 UNUSED(dev);
1055 dev->attributes |= ISC_SOCKEVENTATTR_TRUNC;
1060 dev->attributes |= ISC_SOCKEVENTATTR_CTRUNC;
1087 memmove(&dev->pktinfo, pktinfop,
1089 dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
1094 dev->pktinfo.ipi6_ifindex);
1096 dev->attributes |= ISC_SOCKEVENTATTR_MULTICAST;
1107 dev->timestamp.seconds = tv.tv_sec;
1108 dev->timestamp.nanoseconds = tv.tv_usec * 1000;
1109 dev->attributes |= ISC_SOCKEVENTATTR_TIMESTAMP;
1135 build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
1147 msg->msg_name = (void *)&dev->address.type.sa;
1148 msg->msg_namelen = dev->address.length;
1154 buffer = ISC_LIST_HEAD(dev->bufferlist);
1162 write_count = dev->region.length - dev->n;
1163 iov[0].iov_base = (void *)(dev->region.base + dev->n);
1174 skip_count = dev->n;
1211 && ((dev->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0)) {
1221 dev->pktinfo.ipi6_ifindex);
1232 memmove(pktinfop, &dev->pktinfo, sizeof(struct in6_pktinfo));
1273 build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev,
1284 memset(&dev->address, 0, sizeof(dev->address));
1287 msg->msg_name = (void *)&dev->address.type.sin;
1288 msg->msg_namelen = sizeof(dev->address.type.sin6);
1290 msg->msg_name = (void *)&dev->address.type.sin6;
1291 msg->msg_namelen = sizeof(dev->address.type.sin6);
1294 msg->msg_name = (void *)&dev->address.type.sunix;
1295 msg->msg_namelen = sizeof(dev->address.type.sunix);
1298 msg->msg_name = (void *)&dev->address.type.sa;
1299 msg->msg_namelen = sizeof(dev->address.type);
1302 msg->msg_name = (void *)&dev->address.type.sa;
1303 msg->msg_namelen = sizeof(dev->address.type);
1312 dev->address = sock->peer_address;
1315 buffer = ISC_LIST_HEAD(dev->bufferlist);
1322 read_count = dev->region.length - dev->n;
1323 iov[0].iov_base = (void *)(dev->region.base + dev->n);
1395 isc_socketevent_t *dev)
1399 dev->address = *address;
1401 dev->address = sock->peer_address;
1404 dev->address = sock->peer_address;
1471 doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) {
1481 build_msghdr_recv(sock, dev, &msghdr, iov, &read_count);
1510 dev->result = _isc; \
1519 dev->result = _isc; \
1548 dev->result = isc__errno2result(recv_errno);
1573 dev->address.length = msghdr.msg_namelen;
1574 if (isc_sockaddr_getport(&dev->address) == 0) {
1576 socket_log(sock, &dev->address, IOEVENT,
1585 socket_log(sock, &dev->address, IOEVENT,
1592 * dev entry and adjust how much we read by one.
1596 dev->attributes |= ISC_SOCKEVENTATTR_TRUNC;
1606 process_cmsg(sock, &msghdr, dev);
1611 dev->n += cc;
1613 buffer = ISC_LIST_HEAD(dev->bufferlist);
1636 if (((size_t)cc != read_count) && (dev->n < dev->minimum))
1642 dev->result = ISC_R_SUCCESS;
1648 * DOIO_SUCCESS The operation succeeded. dev->result contains
1652 * dev->result contains the appropriate error.
1660 doio_send(isc_socket_t *sock, isc_socketevent_t *dev) {
1670 build_msghdr_send(sock, dev, &msghdr, iov, &write_count);
1689 dev->result = _isc; \
1698 dev->result = _isc; \
1730 isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf));
1734 dev->result = isc__errno2result(send_errno);
1752 dev->n += cc;
1760 dev->result = ISC_R_SUCCESS;
2765 send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev) {
2768 task = (*dev)->ev_sender;
2770 (*dev)->ev_sender = sock;
2772 if (ISC_LINK_LINKED(*dev, ev_link))
2773 ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link);
2775 if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
2777 isc_task_sendanddetach(&task, (isc_event_t **)dev);
2779 isc_task_send(task, (isc_event_t **)dev);
2788 send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev) {
2791 INSIST(dev != NULL && *dev != NULL);
2793 task = (*dev)->ev_sender;
2794 (*dev)->ev_sender = sock;
2796 if (ISC_LINK_LINKED(*dev, ev_link))
2797 ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link);
2799 if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
2801 isc_task_sendanddetach(&task, (isc_event_t **)dev);
2803 isc_task_send(task, (isc_event_t **)dev);
2821 isc_socket_newconnev_t *dev;
2858 dev = ISC_LIST_HEAD(sock->accept_list);
2859 if (dev == NULL) {
2875 addrlen = sizeof(dev->newsocket->peer_address.type);
2876 memset(&dev->newsocket->peer_address.type, 0, addrlen);
2877 fd = accept(sock->fd, &dev->newsocket->peer_address.type.sa,
2947 } else if (dev->newsocket->peer_address.type.sa.sa_family !=
2954 dev->newsocket->peer_address.
2973 dev->newsocket->peer_address.length = addrlen;
2974 dev->newsocket->pf = sock->pf;
2980 ISC_LIST_UNLINK(sock->accept_list, dev, ev_link);
3004 dev->newsocket->fd = fd;
3005 dev->newsocket->bound = 1;
3006 dev->newsocket->connected = 1;
3011 use_min_mtu(dev->newsocket);
3016 dev->address = dev->newsocket->peer_address;
3019 manager->fds[fd] = dev->newsocket;
3030 socket_log(sock, &dev->newsocket->peer_address, CREATION,
3033 dev->newsocket);
3035 ISC_LIST_APPEND(manager->socklist, dev->newsocket, link);
3042 dev->newsocket->references--;
3043 free_socket(&dev->newsocket);
3049 dev->result = result;
3050 task = dev->ev_sender;
3051 dev->ev_sender = sock;
3053 isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev));
3066 isc_socketevent_t *dev;
3094 dev = ISC_LIST_HEAD(sock->recv_list);
3095 while (dev != NULL) {
3096 switch (doio_recv(sock, dev)) {
3107 dev->result = ISC_R_EOF;
3108 send_recvdone_event(sock, &dev);
3109 dev = ISC_LIST_HEAD(sock->recv_list);
3110 } while (dev != NULL);
3115 send_recvdone_event(sock, &dev);
3119 dev = ISC_LIST_HEAD(sock->recv_list);
3131 isc_socketevent_t *dev;
3162 dev = ISC_LIST_HEAD(sock->send_list);
3163 while (dev != NULL) {
3164 switch (doio_send(sock, dev)) {
3170 send_senddone_event(sock, &dev);
3174 dev = ISC_LIST_HEAD(sock->send_list);
3728 * XXXJT: /dev/poll seems to reject large numbers of events,
3748 manager->devpoll_fd = open("/dev/poll", O_RDWR);
3753 "open(/dev/poll) %s: %s",
4179 socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
4187 dev->ev_sender = task;
4190 io_state = doio_recv(sock, dev);
4196 io_state = doio_recv(sock, dev);
4210 dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
4223 ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link);
4227 dev, ntask);
4234 dev->result = ISC_R_EOF;
4240 send_recvdone_event(sock, &dev);
4255 isc_socketevent_t *dev;
4274 dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg);
4275 if (dev == NULL)
4282 dev->minimum = 1;
4285 dev->minimum = iocount;
4287 dev->minimum = minimum;
4296 ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
4300 return (socket_recv(sock, dev, task, 0));
4307 isc_socketevent_t *dev;
4318 dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg);
4319 if (dev == NULL)
4322 return (isc_socket_recv2(sock, region, minimum, task, dev, 0));
4354 socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
4363 dev->ev_sender = task;
4365 set_dev_address(address, sock, dev);
4367 dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
4368 dev->pktinfo = *pktinfo;
4370 if (!isc_sockaddr_issitelocal(&dev->address) &&
4371 !isc_sockaddr_islinklocal(&dev->address)) {
4381 dev->pktinfo.ipi6_ifindex = 0;
4386 io_state = doio_send(sock, dev);
4392 io_state = doio_send(sock, dev);
4405 dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
4421 ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link);
4425 dev, ntask);
4435 send_senddone_event(sock, &dev);
4461 isc_socketevent_t *dev;
4474 dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
4475 if (dev == NULL)
4478 dev->region = *region;
4480 return (socket_send(sock, dev, task, address, pktinfo, 0));
4506 isc_socketevent_t *dev;
4523 dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
4524 if (dev == NULL)
4533 ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
4537 return (socket_send(sock, dev, task, address, pktinfo, flags));
4892 isc_socket_newconnev_t *dev;
4912 dev = (isc_socket_newconnev_t *)
4914 action, arg, sizeof(*dev));
4915 if (dev == NULL) {
4919 ISC_LINK_INIT(dev, ev_link);
4923 isc_event_free(ISC_EVENT_PTR(&dev));
4935 isc_event_free(ISC_EVENT_PTR(&dev));
4942 dev->ev_sender = ntask;
4943 dev->newsocket = nsock;
4953 ISC_LIST_ENQUEUE(sock->accept_list, dev, ev_link);
4966 isc_socket_connev_t *dev;
4989 dev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock,
4992 sizeof(*dev));
4993 if (dev == NULL) {
4997 ISC_LINK_INIT(dev, ev_link);
5020 #define ERROR_MATCH(a, b) case a: dev->result = b; goto err_exit;
5047 isc_event_free(ISC_EVENT_PTR(&dev));
5052 isc_task_send(task, ISC_EVENT_PTR(&dev));
5067 dev->result = ISC_R_SUCCESS;
5068 isc_task_send(task, ISC_EVENT_PTR(&dev));
5087 dev->ev_sender = ntask;
5097 sock->connect_ev = dev;
5109 isc_socket_connev_t *dev;
5139 dev = sock->connect_ev;
5140 if (dev == NULL) {
5180 #define ERROR_MATCH(a, b) case a: dev->result = b; break;
5197 dev->result = ISC_R_UNEXPECTED;
5208 dev->result = ISC_R_SUCCESS;
5217 task = dev->ev_sender;
5218 dev->ev_sender = sock;
5219 isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev));
5307 isc_socketevent_t *dev;
5311 dev = ISC_LIST_HEAD(sock->recv_list);
5313 while (dev != NULL) {
5314 current_task = dev->ev_sender;
5315 next = ISC_LIST_NEXT(dev, ev_link);
5318 dev->result = ISC_R_CANCELED;
5319 send_recvdone_event(sock, &dev);
5321 dev = next;
5327 isc_socketevent_t *dev;
5331 dev = ISC_LIST_HEAD(sock->send_list);
5333 while (dev != NULL) {
5334 current_task = dev->ev_sender;
5335 next = ISC_LIST_NEXT(dev, ev_link);
5338 dev->result = ISC_R_CANCELED;
5339 send_senddone_event(sock, &dev);
5341 dev = next;
5347 isc_socket_newconnev_t *dev;
5351 dev = ISC_LIST_HEAD(sock->accept_list);
5352 while (dev != NULL) {
5353 current_task = dev->ev_sender;
5354 next = ISC_LIST_NEXT(dev, ev_link);
5358 ISC_LIST_UNLINK(sock->accept_list, dev,
5361 dev->newsocket->references--;
5362 free_socket(&dev->newsocket);
5364 dev->result = ISC_R_CANCELED;
5365 dev->ev_sender = sock;
5367 ISC_EVENT_PTR(&dev));
5370 dev = next;
5379 isc_socket_connev_t *dev;
5385 dev = sock->connect_ev;
5386 current_task = dev->ev_sender;
5391 dev->result = ISC_R_CANCELED;
5392 dev->ev_sender = sock;
5394 ISC_EVENT_PTR(&dev));