static int exec_IsSet(struct fdescriptor *d, const fd_set *fdset) { struct physical *p = descriptor2physical(d); struct execdevice *dev = device2exec(p->handler); int result = dev->fd_out >= 0 && FD_ISSET(dev->fd_out, fdset); result += physical_IsSet(d, fdset); return result; }
static int ether_IsSet(struct fdescriptor *d, const fd_set *fdset) { struct physical *p = descriptor2physical(d); struct etherdevice *dev = device2ether(p->handler); int result; result = dev->cs >= 0 && FD_ISSET(dev->cs, fdset); result += physical_IsSet(d, fdset); return result; }
static void ng_DescriptorRead(struct fdescriptor *d, struct bundle *bundle, const fd_set *fdset) { struct physical *p = descriptor2physical(d); struct ngdevice *dev = device2ng(p->handler); if (dev->cs >= 0 && FD_ISSET(dev->cs, fdset)) ng_MessageIn(p, NULL, 0); if (physical_IsSet(d, fdset)) physical_DescriptorRead(d, bundle, fdset); }
static void ether_DescriptorRead(struct fdescriptor *d, struct bundle *bundle, const fd_set *fdset) { struct physical *p = descriptor2physical(d); struct etherdevice *dev = device2ether(p->handler); if (dev->cs >= 0 && FD_ISSET(dev->cs, fdset)) { ether_MessageIn(dev); if (dev->connected == CARRIER_LOST) { log_Printf(LogPHASE, "%s: Device disconnected\n", p->link.name); datalink_Down(p->dl, CLOSE_NORMAL); return; } } if (physical_IsSet(d, fdset)) physical_DescriptorRead(d, bundle, fdset); }
static int chat_IsSet(struct fdescriptor *d, const fd_set *fdset) { struct chat *c = descriptor2chat(d); return c->argptr && physical_IsSet(&c->physical->desc, fdset); }