Annotation of embedaddon/mtr/packet/command.h, revision 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_H
        !            20: #define COMMAND_H
        !            21: 
        !            22: #include "platform.h"
        !            23: #include "probe.h"
        !            24: 
        !            25: #define COMMAND_BUFFER_SIZE 4096
        !            26: 
        !            27: #ifdef PLATFORM_CYGWIN
        !            28: #include "command_cygwin.h"
        !            29: #else
        !            30: #include "command_unix.h"
        !            31: #endif
        !            32: 
        !            33: /*  Storage for incoming commands, prior to command parsing  */
        !            34: struct command_buffer_t {
        !            35:     /*  The file descriptor of the incoming command stream  */
        !            36:     int command_stream;
        !            37: 
        !            38:     /*  Storage to read commands into  */
        !            39:     char incoming_buffer[COMMAND_BUFFER_SIZE];
        !            40: 
        !            41:     /*  The number of bytes read so far in incoming_buffer  */
        !            42:     int incoming_read_position;
        !            43: 
        !            44:     /*  Platform specific  */
        !            45:     struct command_buffer_platform_t platform;
        !            46: };
        !            47: 
        !            48: void init_command_buffer(
        !            49:     struct command_buffer_t *command_buffer,
        !            50:     int command_stream);
        !            51: 
        !            52: int read_commands(
        !            53:     struct command_buffer_t *buffer);
        !            54: 
        !            55: void dispatch_buffer_commands(
        !            56:     struct command_buffer_t *buffer,
        !            57:     struct net_state_t *net_state);
        !            58: 
        !            59: #endif

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