Esempio n. 1
0
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);
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
inline int network_get_recvq_fd(network_t * network) {
    return queue_get_fd(network->recvq);
}
Esempio n. 4
0
inline int network_get_sendq_fd(network_t * network) {
    return queue_get_fd(network->sendq);
}