File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mtr / packet / command.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:07:30 2021 UTC (4 years ago) by misho
Branches: mtr, MAIN
CVS tags: v0_95, v0_94, HEAD
mtr 0.94

    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 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.
   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>