X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/0c60e90bdf1a75402f9cc86eb300c5619dd895bc..b29b333865c98b5e48073731980fa6c3cc58f1eb:/rtems/gw/cangw/helpers.c diff --git a/rtems/gw/cangw/helpers.c b/rtems/gw/cangw/helpers.c index 0f94242..117c469 100644 --- a/rtems/gw/cangw/helpers.c +++ b/rtems/gw/cangw/helpers.c @@ -17,6 +17,9 @@ #include "helpers.h" #include "gw.h" +#include +#include "networkconfig.h" + extern unsigned long int total_1, total_2, succ_1, succ_2, err_1, err_2; @@ -87,4 +90,29 @@ int start_can(int argc, char** argv){ int end_can(int argc, char** argv){ return end_GW(); +} + +int show_net(int argc, char** argv){ + rtems_bsdnet_show_if_stats(); + rtems_bsdnet_show_ip_stats(); + rtems_bsdnet_show_icmp_stats(); + rtems_bsdnet_show_tcp_stats(); + rtems_bsdnet_show_udp_stats(); + rtems_bsdnet_show_mbuf_stats(); + rtems_bsdnet_show_inet_routes(); + return 0; +} + +int start_net(int argc, char** argv){ + int res; + printf("Initializing Network\n"); + res = rtems_bsdnet_initialize_network (); + if (res < 0){ + printf("Error while initializing network: %d %s\n", errno, strerror(errno)); + return 1; + } + printf("Success\n"); + printf("About to show routes.\n"); + rtems_bsdnet_show_inet_routes (); + return 0; } \ No newline at end of file