URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [tags/] [initial/] [orpmon/] [cmds/] [global.c] - Rev 1776
Go to most recent revision | Compare with Previous | Blame | View Log
#include "common.h" global_struct global; int src_addr_cmd (int argc, char *argv[]) { if (argc == 1) { global.src_addr = strtoul (argv[0]); return 0; } else return -1; } int dst_addr_cmd (int argc, char *argv[]) { if (argc == 1) { global.dst_addr = strtoul (argv[0]); return 0; } else return -1; } int length_cmd (int argc, char *argv[]) { if (argc == 1) { global.length = strtoul (argv[0]); return 0; } else return -1; } int ip_cmd (int argc, char *argv[]) { if (argc == 1) { global.ip = strtoul (argv[0]); return 0; } else return -1; } #if HELP_ENABLED int globals_cmd (int argc, char *argv[]) { if (argc) return -1; printf ("src_addr = %08lx\n", global.src_addr); printf ("dst_addr = %08lx\n", global.dst_addr); printf ("length = %08lx\n", global.length); printf ("ip = %08lx\n", global.ip); return 0; } #endif /* HELP_ENABLED */ void module_global_init (void) { register_command ("src_addr", "<value>", "sets global parameter source address", src_addr_cmd); register_command ("dst_addr", "<value>", "sets global parameter destination address", dst_addr_cmd); register_command ("length", "<value>", "sets global parameter length", length_cmd); register_command ("ip", "<value>", "sets global parameter ip address", ip_cmd); if (HELP_ENABLED) register_command ("globals", "", "show globals", globals_cmd); }
Go to most recent revision | Compare with Previous | Blame | View Log