--- /dev/null
+#include "shell.h"
+
+void shell_port(char ** argv, int elem) {
+
+ int n;
+
+ if (elem == 1) {
+
+ return;
+ }
+ if (strncmp(argv[1], "show", 4) == 0) {
+ printf("Port\tSpeed\t\tBytes In\t\tBytes Out\n");
+ for (n = 0; n< 5; n++) {
+ printf("%i\t%s\t% 8lu\t\t% 8lu\n", n,
+ (settings.portStatistics[n].state == 0x05 ? "1000 Mbit/s" : (settings.portStatistics[n].state == 0x04 ? "100 Mbit/s" : (settings.portStatistics[n].state == 0x03 ? "10 Mbit/s": (settings.portStatistics[n].state == 0x00 ? "No Cable": "???")))),
+ settings.portStatistics[n].bytesIn,
+ settings.portStatistics[n].bytesOut
+ );
+ }
+ }
+}