Lines Matching defs:dev

186  * If this macro is defined, enable workaround for a Solaris /dev/poll kernel
1032 * Canceling read or write polling via /dev/poll is tricky. Since it
1311 process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
1324 * msg and dev are used only when ISC_NET_BSD44MSGHDR is defined.
1330 UNUSED(dev);
1336 dev->attributes |= ISC_SOCKEVENTATTR_TRUNC;
1341 dev->attributes |= ISC_SOCKEVENTATTR_CTRUNC;
1368 memmove(&dev->pktinfo, pktinfop,
1370 dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
1375 dev->pktinfo.ipi6_ifindex);
1377 dev->attributes |= ISC_SOCKEVENTATTR_MULTICAST;
1388 dev->timestamp.seconds = tv.tv_sec;
1389 dev->timestamp.nanoseconds = tv.tv_usec * 1000;
1390 dev->attributes |= ISC_SOCKEVENTATTR_TIMESTAMP;
1398 dev->dscp = *(int *)CMSG_DATA(cmsgp);
1399 dev->dscp >>= 2;
1400 dev->attributes |= ISC_SOCKEVENTATTR_DSCP;
1412 dev->dscp = (int) *(unsigned char *)CMSG_DATA(cmsgp);
1413 dev->dscp >>= 2;
1414 dev->attributes |= ISC_SOCKEVENTATTR_DSCP;
1439 build_msghdr_send(isc__socket_t *sock, isc_socketevent_t *dev,
1457 msg->msg_name = (void *)&dev->address.type.sa;
1458 msg->msg_namelen = dev->address.length;
1464 buffer = ISC_LIST_HEAD(dev->bufferlist);
1472 write_count = dev->region.length - dev->n;
1473 iov[0].iov_base = (void *)(dev->region.base + dev->n);
1484 skip_count = dev->n;
1523 ((dev->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0))
1530 dev->pktinfo.ipi6_ifindex);
1541 memmove(pktinfop, &dev->pktinfo, sizeof(struct in6_pktinfo));
1547 ((dev->attributes & ISC_SOCKEVENTATTR_USEMINMTU) != 0))
1565 INSIST((int)dev->dscp == isc_dscp_check_value);
1571 ((dev->attributes & ISC_SOCKEVENTATTR_DSCP) != 0))
1573 int dscp = (dev->dscp << 2) & 0xff;
1575 INSIST(dev->dscp < 0x40);
1589 } else if (sock->pf == AF_INET && sock->dscp != dev->dscp) {
1620 } else if (sock->pf == AF_INET6 && sock->dscp != dev->dscp) {
1662 build_msghdr_recv(isc__socket_t *sock, isc_socketevent_t *dev,
1673 memset(&dev->address, 0, sizeof(dev->address));
1676 msg->msg_name = (void *)&dev->address.type.sin;
1677 msg->msg_namelen = sizeof(dev->address.type.sin6);
1679 msg->msg_name = (void *)&dev->address.type.sin6;
1680 msg->msg_namelen = sizeof(dev->address.type.sin6);
1683 msg->msg_name = (void *)&dev->address.type.sunix;
1684 msg->msg_namelen = sizeof(dev->address.type.sunix);
1687 msg->msg_name = (void *)&dev->address.type.sa;
1688 msg->msg_namelen = sizeof(dev->address.type);
1691 msg->msg_name = (void *)&dev->address.type.sa;
1692 msg->msg_namelen = sizeof(dev->address.type);
1701 dev->address = sock->peer_address;
1704 buffer = ISC_LIST_HEAD(dev->bufferlist);
1711 read_count = dev->region.length - dev->n;
1712 iov[0].iov_base = (void *)(dev->region.base + dev->n);
1783 isc_socketevent_t *dev)
1787 dev->address = *address;
1789 dev->address = sock->peer_address;
1792 dev->address = sock->peer_address;
1860 doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) {
1870 build_msghdr_recv(sock, dev, &msghdr, iov, &read_count);
1899 dev->result = _isc; \
1908 dev->result = _isc; \
1937 dev->result = isc__errno2result(recv_errno);
1963 dev->address.length = msghdr.msg_namelen;
1964 if (isc_sockaddr_getport(&dev->address) == 0) {
1966 socket_log(sock, &dev->address, IOEVENT,
1981 socket_log(sock, &dev->address, IOEVENT,
1988 * dev entry and adjust how much we read by one.
1992 dev->attributes |= ISC_SOCKEVENTATTR_TRUNC;
2001 process_cmsg(sock, &msghdr, dev);
2006 dev->n += cc;
2008 buffer = ISC_LIST_HEAD(dev->bufferlist);
2031 if (((size_t)cc != read_count) && (dev->n < dev->minimum))
2037 dev->result = ISC_R_SUCCESS;
2043 * DOIO_SUCCESS The operation succeeded. dev->result contains
2047 * dev->result contains the appropriate error.
2055 doio_send(isc__socket_t *sock, isc_socketevent_t *dev) {
2065 build_msghdr_send(sock, dev, &msghdr, iov, &write_count);
2085 dev->result = ISC_R_WOULDBLOCK;
2092 dev->result = _isc; \
2101 dev->result = _isc; \
2133 isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf));
2137 dev->result = isc__errno2result(send_errno);
2155 dev->n += cc;
2163 dev->result = ISC_R_SUCCESS;
3452 send_recvdone_event(isc__socket_t *sock, isc_socketevent_t **dev) {
3455 task = (*dev)->ev_sender;
3457 (*dev)->ev_sender = sock;
3459 if (ISC_LINK_LINKED(*dev, ev_link))
3460 ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link);
3462 if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
3464 isc_task_sendanddetach(&task, (isc_event_t **)dev);
3466 isc_task_send(task, (isc_event_t **)dev);
3475 send_senddone_event(isc__socket_t *sock, isc_socketevent_t **dev) {
3478 INSIST(dev != NULL && *dev != NULL);
3480 task = (*dev)->ev_sender;
3481 (*dev)->ev_sender = sock;
3483 if (ISC_LINK_LINKED(*dev, ev_link))
3484 ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link);
3486 if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
3488 isc_task_sendanddetach(&task, (isc_event_t **)dev);
3490 isc_task_send(task, (isc_event_t **)dev);
3499 send_connectdone_event(isc__socket_t *sock, isc_socket_connev_t **dev) {
3502 INSIST(dev != NULL && *dev != NULL);
3504 task = (*dev)->ev_sender;
3505 (*dev)->ev_sender = sock;
3507 if (ISC_LINK_LINKED(*dev, ev_link))
3508 ISC_LIST_DEQUEUE(sock->connect_list, *dev, ev_link);
3510 isc_task_sendanddetach(&task, (isc_event_t **)dev);
3528 isc_socket_newconnev_t *dev;
3565 dev = ISC_LIST_HEAD(sock->accept_list);
3566 if (dev == NULL) {
3582 addrlen = sizeof(NEWCONNSOCK(dev)->peer_address.type);
3583 memset(&NEWCONNSOCK(dev)->peer_address.type, 0, addrlen);
3584 fd = accept(sock->fd, &NEWCONNSOCK(dev)->peer_address.type.sa,
3654 } else if (NEWCONNSOCK(dev)->peer_address.type.sa.sa_family !=
3661 NEWCONNSOCK(dev)->peer_address.
3680 NEWCONNSOCK(dev)->peer_address.length = addrlen;
3681 NEWCONNSOCK(dev)->pf = sock->pf;
3687 ISC_LIST_UNLINK(sock->accept_list, dev, ev_link);
3711 NEWCONNSOCK(dev)->fd = fd;
3712 NEWCONNSOCK(dev)->bound = 1;
3713 NEWCONNSOCK(dev)->connected = 1;
3718 use_min_mtu(NEWCONNSOCK(dev));
3719 set_tcp_maxseg(NEWCONNSOCK(dev), 1280 - 20 - 40);
3724 setdscp(NEWCONNSOCK(dev), sock->dscp);
3729 dev->address = NEWCONNSOCK(dev)->peer_address;
3731 if (NEWCONNSOCK(dev)->active == 0) {
3733 NEWCONNSOCK(dev)->statsindex[STATID_ACTIVE]);
3734 NEWCONNSOCK(dev)->active = 1;
3738 manager->fds[fd] = NEWCONNSOCK(dev);
3752 socket_log(sock, &NEWCONNSOCK(dev)->peer_address, CREATION,
3755 dev->newsocket);
3757 ISC_LIST_APPEND(manager->socklist, NEWCONNSOCK(dev), link);
3764 NEWCONNSOCK(dev)->references--;
3765 free_socket((isc__socket_t **)&dev->newsocket);
3771 dev->result = result;
3772 task = dev->ev_sender;
3773 dev->ev_sender = sock;
3775 isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev));
3788 isc_socketevent_t *dev;
3816 dev = ISC_LIST_HEAD(sock->recv_list);
3817 while (dev != NULL) {
3818 switch (doio_recv(sock, dev)) {
3829 dev->result = ISC_R_EOF;
3830 send_recvdone_event(sock, &dev);
3831 dev = ISC_LIST_HEAD(sock->recv_list);
3832 } while (dev != NULL);
3837 send_recvdone_event(sock, &dev);
3841 dev = ISC_LIST_HEAD(sock->recv_list);
3853 isc_socketevent_t *dev;
3884 dev = ISC_LIST_HEAD(sock->send_list);
3885 while (dev != NULL) {
3886 switch (doio_send(sock, dev)) {
3892 send_senddone_event(sock, &dev);
3896 dev = ISC_LIST_HEAD(sock->send_list);
4515 manager->devpoll_fd = open("/dev/poll", O_RDWR);
4520 "open(/dev/poll) %s: %s",
4975 socket_recv(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
4983 dev->ev_sender = task;
4986 io_state = doio_recv(sock, dev);
4992 io_state = doio_recv(sock, dev);
5006 dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
5019 ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link);
5023 dev, ntask);
5030 dev->result = ISC_R_EOF;
5036 send_recvdone_event(sock, &dev);
5052 isc_socketevent_t *dev;
5071 dev = allocate_socketevent(manager->mctx, sock,
5073 if (dev == NULL)
5080 dev->minimum = 1;
5083 dev->minimum = iocount;
5085 dev->minimum = minimum;
5094 ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
5098 return (socket_recv(sock, dev, task, 0));
5107 isc_socketevent_t *dev;
5118 dev = allocate_socketevent(manager->mctx, sock,
5120 if (dev == NULL)
5123 return (isc__socket_recv2(sock0, region, minimum, task, dev, 0));
5157 socket_send(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
5166 dev->ev_sender = task;
5168 set_dev_address(address, sock, dev);
5170 dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
5171 dev->pktinfo = *pktinfo;
5173 if (!isc_sockaddr_issitelocal(&dev->address) &&
5174 !isc_sockaddr_islinklocal(&dev->address)) {
5184 dev->pktinfo.ipi6_ifindex = 0;
5189 io_state = doio_send(sock, dev);
5195 io_state = doio_send(sock, dev);
5208 dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
5224 ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link);
5228 dev, ntask);
5240 send_senddone_event(sock, &dev);
5267 isc_socketevent_t *dev;
5280 dev = allocate_socketevent(manager->mctx, sock,
5282 if (dev == NULL)
5285 dev->region = *region;
5287 return (socket_send(sock, dev, task, address, pktinfo, 0));
5314 isc_socketevent_t *dev;
5331 dev = allocate_socketevent(manager->mctx, sock,
5333 if (dev == NULL)
5342 ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
5346 return (socket_send(sock, dev, task, address, pktinfo, flags));
5779 isc_socket_newconnev_t *dev;
5799 dev = (isc_socket_newconnev_t *)
5801 action, arg, sizeof(*dev));
5802 if (dev == NULL) {
5806 ISC_LINK_INIT(dev, ev_link);
5810 isc_event_free(ISC_EVENT_PTR(&dev));
5822 isc_event_free(ISC_EVENT_PTR(&dev));
5829 dev->ev_sender = ntask;
5830 dev->newsocket = (isc_socket_t *)nsock;
5840 ISC_LIST_ENQUEUE(sock->accept_list, dev, ev_link);
5854 isc_socket_connev_t *dev;
5875 dev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock,
5878 sizeof(*dev));
5879 if (dev == NULL) {
5883 ISC_LINK_INIT(dev, ev_link);
5892 dev->result = ISC_R_SUCCESS;
5893 isc_task_send(task, ISC_EVENT_PTR(&dev));
5921 #define ERROR_MATCH(a, b) case a: dev->result = b; goto err_exit;
5948 isc_event_free(ISC_EVENT_PTR(&dev));
5953 isc_task_send(task, ISC_EVENT_PTR(&dev));
5968 dev->result = ISC_R_SUCCESS;
5969 isc_task_send(task, ISC_EVENT_PTR(&dev));
5986 dev->ev_sender = ntask;
5998 ISC_LIST_ENQUEUE(sock->connect_list, dev, ev_link);
6010 isc_socket_connev_t *dev;
6041 dev = ISC_LIST_HEAD(sock->connect_list);
6042 if (dev == NULL) {
6116 dev->result = result;
6117 send_connectdone_event(sock, &dev);
6118 dev = ISC_LIST_HEAD(sock->connect_list);
6119 } while (dev != NULL);
6212 isc_socketevent_t *dev;
6216 dev = ISC_LIST_HEAD(sock->recv_list);
6218 while (dev != NULL) {
6219 current_task = dev->ev_sender;
6220 next = ISC_LIST_NEXT(dev, ev_link);
6223 dev->result = ISC_R_CANCELED;
6224 send_recvdone_event(sock, &dev);
6226 dev = next;
6232 isc_socketevent_t *dev;
6236 dev = ISC_LIST_HEAD(sock->send_list);
6238 while (dev != NULL) {
6239 current_task = dev->ev_sender;
6240 next = ISC_LIST_NEXT(dev, ev_link);
6243 dev->result = ISC_R_CANCELED;
6244 send_senddone_event(sock, &dev);
6246 dev = next;
6252 isc_socket_newconnev_t *dev;
6256 dev = ISC_LIST_HEAD(sock->accept_list);
6257 while (dev != NULL) {
6258 current_task = dev->ev_sender;
6259 next = ISC_LIST_NEXT(dev, ev_link);
6263 ISC_LIST_UNLINK(sock->accept_list, dev,
6266 NEWCONNSOCK(dev)->references--;
6267 free_socket((isc__socket_t **)&dev->newsocket);
6269 dev->result = ISC_R_CANCELED;
6270 dev->ev_sender = sock;
6272 ISC_EVENT_PTR(&dev));
6275 dev = next;
6281 isc_socket_connev_t *dev;
6288 dev = ISC_LIST_HEAD(sock->connect_list);
6290 while (dev != NULL) {
6291 current_task = dev->ev_sender;
6292 next = ISC_LIST_NEXT(dev, ev_link);
6295 dev->result = ISC_R_CANCELED;
6296 send_connectdone_event(sock, &dev);
6298 dev = next;