int queue_process_pending(struct queue *self, int max_count) { int fd; if ((fd = queue_get_fd(self)) < 0) { /* exception has been thrown by queue_get_fd */ return -1; } else if ((!self->_mode_set)) { if (queue_set_mode(self, NFQNL_COPY_PACKET) < 0) { /* exception has been thrown by queue_set_mode */ return -1; } } return _process_loop(self, fd, MSG_DONTWAIT, max_count); }
int queue_try_run(struct queue *self) { int fd; if ((fd = queue_get_fd(self)) < 0) { /* exception has been thrown by queue_get_fd */ return -1; } else if ((!self->_mode_set)) { if (queue_set_mode(self, NFQNL_COPY_PACKET) < 0) { /* exception has been thrown by queue_set_mode */ return -1; } } return _process_loop(self, fd, 0, -1); }
inline int network_get_recvq_fd(network_t * network) { return queue_get_fd(network->recvq); }
inline int network_get_sendq_fd(network_t * network) { return queue_get_fd(network->sendq); }