Annotation of embedaddon/mtr/packet/cmdparse.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 CMDPARSE_H
        !            20: #define CMDPARSE_H
        !            21: 
        !            22: enum {
        !            23:     MAX_COMMAND_ARGUMENTS = 16,
        !            24:     MAX_COMMAND_TOKENS = MAX_COMMAND_ARGUMENTS * 2 + 2
        !            25: };
        !            26: 
        !            27: /*  Parsed commands, or command replies, ready for semantic interpretation  */
        !            28: struct command_t {
        !            29:     /*  A unique value for matching command requests with replies  */
        !            30:     int token;
        !            31: 
        !            32:     /*  Text indiciating the command type, or reply type  */
        !            33:     char *command_name;
        !            34: 
        !            35:     /*  The number of key, value argument pairs used  */
        !            36:     int argument_count;
        !            37: 
        !            38:     /*  Names for each argument  */
        !            39:     char *argument_name[MAX_COMMAND_ARGUMENTS];
        !            40: 
        !            41:     /*  Values for each argument, parallel to the argument_name array  */
        !            42:     char *argument_value[MAX_COMMAND_ARGUMENTS];
        !            43: };
        !            44: 
        !            45: int parse_command(
        !            46:     struct command_t *command,
        !            47:     char *command_string);
        !            48: 
        !            49: #endif

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