|
Packit |
b802ec |
/*
|
|
Packit |
b802ec |
mtr -- a network diagnostic tool
|
|
Packit |
b802ec |
Copyright (C) 2016 Matt Kimball
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
This program is free software; you can redistribute it and/or modify
|
|
Packit |
b802ec |
it under the terms of the GNU General Public License version 2 as
|
|
Packit |
b802ec |
published by the Free Software Foundation.
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
This program is distributed in the hope that it will be useful,
|
|
Packit |
b802ec |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
b802ec |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
b802ec |
GNU General Public License for more details.
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
You should have received a copy of the GNU General Public License
|
|
Packit |
b802ec |
along with this program; if not, write to the Free Software
|
|
Packit |
b802ec |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
Packit |
b802ec |
*/
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
#ifndef COMMAND_CYGWIN_H
|
|
Packit |
b802ec |
#define COMMAND_CYGWIN_H
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
/*
|
|
Packit |
b802ec |
Though Cygwin supports the usual Unix non-blocking reads on
|
|
Packit |
b802ec |
the command stream, we've got to use Overlapped I/O instead because
|
|
Packit |
b802ec |
ICMP.DLL's support for sending probes requires Overlapped I/O
|
|
Packit |
b802ec |
and alertable waits for notification of replies. Since we need
|
|
Packit |
b802ec |
alertable waits, we can't use Cygwin's select to determine when
|
|
Packit |
b802ec |
command stream data is available, but Overlapped I/O completion
|
|
Packit |
b802ec |
will work.
|
|
Packit |
b802ec |
*/
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
/* Overlapped I/O manament for Windows command buffer reads */
|
|
Packit |
b802ec |
struct command_buffer_platform_t {
|
|
Packit |
b802ec |
/* true if an overlapped I/O read is active */
|
|
Packit |
b802ec |
bool read_active;
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
/* true if the command pipe is still open */
|
|
Packit |
b802ec |
bool pipe_open;
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
/* Windows OVERLAPPED I/O data */
|
|
Packit |
b802ec |
OVERLAPPED overlapped;
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
/* The buffer which active OVERLAPPED reads read into */
|
|
Packit |
b802ec |
char overlapped_buffer[COMMAND_BUFFER_SIZE];
|
|
Packit |
b802ec |
};
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
struct command_buffer_t;
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
void start_read_command(
|
|
Packit |
b802ec |
struct command_buffer_t *buffer);
|
|
Packit |
b802ec |
|
|
Packit |
b802ec |
#endif
|