MCPcopy Index your code
hub / github.com/F-Stack/f-stack / main

Function main

dpdk/app/dumpcap/main.c:942–1037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940}
941
942int main(int argc, char **argv)
943{
944 struct rte_ring *r;
945 struct rte_mempool *mp;
946 struct sigaction action = {
947 .sa_flags = SA_RESTART,
948 .sa_handler = signal_handler,
949 };
950 struct sigaction origaction;
951 dumpcap_out_t out;
952 char *p;
953
954 p = strrchr(argv[0], '/');
955 if (p == NULL)
956 progname = argv[0];
957 else
958 progname = p + 1;
959
960 parse_opts(argc, argv);
961 dpdk_init();
962
963 if (show_interfaces)
964 dump_interfaces();
965
966 if (rte_eth_dev_count_avail() == 0)
967 rte_exit(EXIT_FAILURE, "No Ethernet ports found\n");
968
969 if (TAILQ_EMPTY(&interfaces))
970 set_default_interface();
971 else
972 find_interfaces();
973
974 compile_filters();
975
976 sigemptyset(&action.sa_mask);
977 sigaction(SIGTERM, &action, NULL);
978 sigaction(SIGINT, &action, NULL);
979 sigaction(SIGPIPE, &action, NULL);
980 sigaction(SIGHUP, NULL, &origaction);
981 if (origaction.sa_handler == SIG_DFL)
982 sigaction(SIGHUP, &action, NULL);
983
984 enable_primary_monitor();
985
986 if (print_stats) {
987 statistics_loop();
988 exit(0);
989 }
990
991 r = create_ring();
992 mp = create_mempool();
993 out = create_output();
994
995 start_time = time(NULL);
996 enable_pdump(r, mp);
997
998 if (!quiet) {
999 fprintf(stderr, "Packets captured: ");

Callers

nothing calls this directly

Calls 15

strrchrFunction · 0.85
dpdk_initFunction · 0.85
dump_interfacesFunction · 0.85
rte_eth_dev_count_availFunction · 0.85
rte_exitFunction · 0.85
set_default_interfaceFunction · 0.85
find_interfacesFunction · 0.85
compile_filtersFunction · 0.85
statistics_loopFunction · 0.85
create_outputFunction · 0.85
show_countFunction · 0.85
process_ringFunction · 0.85

Tested by

no test coverage detected