|
Packit |
9c3e7e |
/**
|
|
Packit |
9c3e7e |
* @file fd.h
|
|
Packit |
9c3e7e |
* @brief Defines a array of file descriptors, useful for polling.
|
|
Packit |
9c3e7e |
* @note Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com>
|
|
Packit |
9c3e7e |
*
|
|
Packit |
9c3e7e |
* This program is free software; you can redistribute it and/or modify
|
|
Packit |
9c3e7e |
* it under the terms of the GNU General Public License as published by
|
|
Packit |
9c3e7e |
* the Free Software Foundation; either version 2 of the License, or
|
|
Packit |
9c3e7e |
* (at your option) any later version.
|
|
Packit |
9c3e7e |
*
|
|
Packit |
9c3e7e |
* This program is distributed in the hope that it will be useful,
|
|
Packit |
9c3e7e |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
9c3e7e |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
9c3e7e |
* GNU General Public License for more details.
|
|
Packit |
9c3e7e |
*
|
|
Packit |
9c3e7e |
* You should have received a copy of the GNU General Public License along
|
|
Packit |
9c3e7e |
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
Packit |
9c3e7e |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
Packit |
9c3e7e |
*/
|
|
Packit |
9c3e7e |
#ifndef HAVE_FD_H
|
|
Packit |
9c3e7e |
#define HAVE_FD_H
|
|
Packit |
9c3e7e |
|
|
Packit |
9c3e7e |
#define N_TIMER_FDS 8
|
|
Packit |
9c3e7e |
|
|
Packit |
9c3e7e |
/*
|
|
Packit |
9c3e7e |
* The order matters here. The DELAY timer must appear before the
|
|
Packit |
9c3e7e |
* ANNOUNCE and SYNC_RX timers in order to correctly handle the case
|
|
Packit |
9c3e7e |
* when the DELAY timer and one of the other two expire during the
|
|
Packit |
9c3e7e |
* same call to poll().
|
|
Packit |
9c3e7e |
*/
|
|
Packit |
9c3e7e |
enum {
|
|
Packit |
9c3e7e |
FD_EVENT,
|
|
Packit |
9c3e7e |
FD_GENERAL,
|
|
Packit |
9c3e7e |
FD_DELAY_TIMER,
|
|
Packit |
9c3e7e |
FD_ANNOUNCE_TIMER,
|
|
Packit |
9c3e7e |
FD_SYNC_RX_TIMER,
|
|
Packit |
9c3e7e |
FD_QUALIFICATION_TIMER,
|
|
Packit |
9c3e7e |
FD_MANNO_TIMER,
|
|
Packit |
9c3e7e |
FD_SYNC_TX_TIMER,
|
|
Packit |
9c3e7e |
FD_UNICAST_REQ_TIMER,
|
|
Packit |
9c3e7e |
FD_UNICAST_SRV_TIMER,
|
|
Packit |
9c3e7e |
FD_RTNL,
|
|
Packit |
9c3e7e |
N_POLLFD,
|
|
Packit |
9c3e7e |
};
|
|
Packit |
9c3e7e |
|
|
Packit |
9c3e7e |
#define FD_FIRST_TIMER FD_DELAY_TIMER
|
|
Packit |
9c3e7e |
|
|
Packit |
9c3e7e |
struct fdarray {
|
|
Packit |
9c3e7e |
int fd[N_POLLFD];
|
|
Packit |
9c3e7e |
};
|
|
Packit |
9c3e7e |
|
|
Packit |
9c3e7e |
#endif
|