* Function handler that opens the pcap file for reading a stores a * reference of it for use it later on. */
| 1035 | * reference of it for use it later on. |
| 1036 | */ |
| 1037 | static int |
| 1038 | open_rx_pcap(const char *key, const char *value, void *extra_args) |
| 1039 | { |
| 1040 | const char *pcap_filename = value; |
| 1041 | struct pmd_devargs *rx = extra_args; |
| 1042 | pcap_t *pcap = NULL; |
| 1043 | |
| 1044 | if (open_single_rx_pcap(pcap_filename, &pcap) < 0) |
| 1045 | return -1; |
| 1046 | |
| 1047 | if (add_queue(rx, pcap_filename, key, pcap, NULL) < 0) { |
| 1048 | pcap_close(pcap); |
| 1049 | return -1; |
| 1050 | } |
| 1051 | |
| 1052 | return 0; |
| 1053 | } |
| 1054 | |
| 1055 | /* |
| 1056 | * Opens a pcap file for writing and stores a reference to it |
nothing calls this directly
no test coverage detected