Annotation of embedaddon/mtr/packet/command.h, revision 1.1.1.2

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: 
1.1.1.2 ! misho      14:     You should have received a copy of the GNU General Public License along
        !            15:     with this program; if not, write to the Free Software Foundation, Inc.,
        !            16:     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1.1       misho      17: */
                     18: 
                     19: #ifndef COMMAND_H
                     20: #define COMMAND_H
                     21: 
                     22: #include "probe.h"
                     23: 
                     24: #define COMMAND_BUFFER_SIZE 4096
                     25: 
                     26: /*  Storage for incoming commands, prior to command parsing  */
                     27: struct command_buffer_t {
                     28:     /*  The file descriptor of the incoming command stream  */
                     29:     int command_stream;
                     30: 
                     31:     /*  Storage to read commands into  */
                     32:     char incoming_buffer[COMMAND_BUFFER_SIZE];
                     33: 
                     34:     /*  The number of bytes read so far in incoming_buffer  */
                     35:     int incoming_read_position;
                     36: };
                     37: 
                     38: void init_command_buffer(
                     39:     struct command_buffer_t *command_buffer,
                     40:     int command_stream);
                     41: 
                     42: int read_commands(
                     43:     struct command_buffer_t *buffer);
                     44: 
                     45: void dispatch_buffer_commands(
                     46:     struct command_buffer_t *buffer,
                     47:     struct net_state_t *net_state);
                     48: 
                     49: #endif

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