* Opens a pcap file for writing and stores a reference to it * for use it later on. */
| 1057 | * for use it later on. |
| 1058 | */ |
| 1059 | static int |
| 1060 | open_tx_pcap(const char *key, const char *value, void *extra_args) |
| 1061 | { |
| 1062 | const char *pcap_filename = value; |
| 1063 | struct pmd_devargs *dumpers = extra_args; |
| 1064 | pcap_dumper_t *dumper; |
| 1065 | |
| 1066 | if (open_single_tx_pcap(pcap_filename, &dumper) < 0) |
| 1067 | return -1; |
| 1068 | |
| 1069 | if (add_queue(dumpers, pcap_filename, key, NULL, dumper) < 0) { |
| 1070 | pcap_dump_close(dumper); |
| 1071 | return -1; |
| 1072 | } |
| 1073 | |
| 1074 | return 0; |
| 1075 | } |
| 1076 | |
| 1077 | /* |
| 1078 | * Opens an interface for reading and writing |
nothing calls this directly
no test coverage detected