Annotation of embedaddon/mtr/packet/command_cygwin.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:     mtr  --  a network diagnostic tool
                      3:     Copyright (C) 2016  Matt Kimball
                      4: 
                      5:     This program is free software; you can redistribute it and/or modify
                      6:     it under the terms of the GNU General Public License version 2 as
                      7:     published by the Free Software Foundation.
                      8: 
                      9:     This program is distributed in the hope that it will be useful,
                     10:     but WITHOUT ANY WARRANTY; without even the implied warranty of
                     11:     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     12:     GNU General Public License for more details.
                     13: 
                     14:     You should have received a copy of the GNU General Public License
                     15:     along with this program; if not, write to the Free Software
                     16:     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                     17: */
                     18: 
                     19: #ifndef COMMAND_CYGWIN_H
                     20: #define COMMAND_CYGWIN_H
                     21: 
                     22: /*
                     23:     Though Cygwin supports the usual Unix non-blocking reads on
                     24:     the command stream, we've got to use Overlapped I/O instead because
                     25:     ICMP.DLL's support for sending probes requires Overlapped I/O
                     26:     and alertable waits for notification of replies.  Since we need
                     27:     alertable waits, we can't use Cygwin's select to determine when
                     28:     command stream data is available, but Overlapped I/O completion
                     29:     will work.
                     30: */
                     31: 
                     32: /*  Overlapped I/O manament for Windows command buffer reads  */
                     33: struct command_buffer_platform_t {
                     34:     /*  true if an overlapped I/O read is active  */
                     35:     bool read_active;
                     36: 
                     37:     /*  true if the command pipe is still open  */
                     38:     bool pipe_open;
                     39: 
                     40:     /*  Windows OVERLAPPED I/O data  */
                     41:     OVERLAPPED overlapped;
                     42: 
                     43:     /*  The buffer which active OVERLAPPED reads read into  */
                     44:     char overlapped_buffer[COMMAND_BUFFER_SIZE];
                     45: };
                     46: 
                     47: struct command_buffer_t;
                     48: 
                     49: void start_read_command(
                     50:     struct command_buffer_t *buffer);
                     51: 
                     52: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>