/* * Mausezahn - A fast versatile traffic generator * Copyright (C) 2008 Herbert Haas * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 2 as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; if not, see http://www.gnu.org/licenses/gpl-2.0.html * */ #include "mz.h" #include "cli.h" int cmd_set(struct cli_def *cli, const char *command, char *argv[], int argc) { libnet_t *l; unsigned int time_factor; int i, cnt, found_dev; char *dum; unsigned char *x; if (argc < 2) { cli_print(cli, "Specify a variable to set:\r\n"); cli_print(cli, "device specify the primary network device\r"); cli_print(cli, "NOTE: The following options are non-MOPS and deprecated:\n"); cli_print(cli, "a|sa specify a MAC source address\r"); cli_print(cli, "b|da specify a MAC destination address\r"); cli_print(cli, "A|SA specify a IP source address\r"); cli_print(cli, "B|DA specify a IP destination address\r"); cli_print(cli, "c|count specify a packet count value\r"); cli_print(cli, "d|delay specify an interpacket delay (usec, msec, or sec)\r"); cli_print(cli, "P|payload specify an ASCII payload\r"); cli_print(cli, "H|hexload specify a hexadecimal payload\r"); cli_print(cli, "p|padding specify a number of padding bytes (total for raw, added otherwise)\r"); cli_print(cli, "Q|vlan specify one ore more 802.1Q vlan tags\r"); cli_print(cli, "M|mpls specify one ore more MPLS labels\r"); cli_print(cli, "\n"); return CLI_OK; } // set primary device if (strncmp(argv[0], "device", 2)==0) { if (strncmp(argv[1],"?",1)==0) { cli_print(cli,"Specify the primary network device (use 'show dev' for a list)\n"); } else { if (strlen(argv[1])) { found_dev = 0; for (i=0; i MAX_PAYLOAD_SIZE) { cli_print(cli, "Note: Padding too big! However, let's try and see what happens...\n"); } } } // DEFAULT ANSWER: else { cli_print(cli, "Unknown variable '%s'\n",argv[0]); } return CLI_OK; }