|
44 | 44 |
|
45 | 45 | // clang-format off
|
46 | 46 | static struct option FilterTrafficOptions[] = {
|
47 |
| - { "dpdk-ports", required_argument, 0, 'd' }, |
48 |
| - { "send-matched-packets", optional_argument, 0, 's' }, |
49 |
| - { "save-matched-packets", optional_argument, 0, 'f' }, |
50 |
| - { "match-source-ip", optional_argument, 0, 'i' }, |
51 |
| - { "match-dest-ip", optional_argument, 0, 'I' }, |
52 |
| - { "match-source-port", optional_argument, 0, 'p' }, |
53 |
| - { "match-dest-port", optional_argument, 0, 'P' }, |
54 |
| - { "match-protocol", optional_argument, 0, 'o' }, |
55 |
| - { "core-mask", optional_argument, 0, 'c' }, |
56 |
| - { "mbuf-pool-size", optional_argument, 0, 'm' }, |
57 |
| - { "rx-queues", optional_argument, 0, 'r' }, |
58 |
| - { "tx-queues", optional_argument, 0, 't' }, |
59 |
| - { "help", optional_argument, 0, 'h' }, |
60 |
| - { "version", optional_argument, 0, 'v' }, |
61 |
| - { "list", optional_argument, 0, 'l' }, |
62 |
| - { 0, 0, 0, 0 } |
| 47 | + { "dpdk-ports", required_argument, nullptr, 'd' }, |
| 48 | + { "send-matched-packets", optional_argument, nullptr, 's' }, |
| 49 | + { "save-matched-packets", optional_argument, nullptr, 'f' }, |
| 50 | + { "match-source-ip", optional_argument, nullptr, 'i' }, |
| 51 | + { "match-dest-ip", optional_argument, nullptr, 'I' }, |
| 52 | + { "match-source-port", optional_argument, nullptr, 'p' }, |
| 53 | + { "match-dest-port", optional_argument, nullptr, 'P' }, |
| 54 | + { "match-protocol", optional_argument, nullptr, 'o' }, |
| 55 | + { "core-mask", optional_argument, nullptr, 'c' }, |
| 56 | + { "mbuf-pool-size", optional_argument, nullptr, 'm' }, |
| 57 | + { "rx-queues", optional_argument, nullptr, 'r' }, |
| 58 | + { "tx-queues", optional_argument, nullptr, 't' }, |
| 59 | + { "help", optional_argument, nullptr, 'h' }, |
| 60 | + { "version", optional_argument, nullptr, 'v' }, |
| 61 | + { "list", optional_argument, nullptr, 'l' }, |
| 62 | + { nullptr, 0, nullptr, 0 } |
63 | 63 | };
|
64 | 64 | // clang-format on
|
65 | 65 |
|
@@ -235,7 +235,7 @@ struct FilterTrafficArgs
|
235 | 235 | bool shouldStop;
|
236 | 236 | std::vector<pcpp::DpdkWorkerThread*>* workerThreadsVector;
|
237 | 237 |
|
238 |
| - FilterTrafficArgs() : shouldStop(false), workerThreadsVector(NULL) |
| 238 | + FilterTrafficArgs() : shouldStop(false), workerThreadsVector(nullptr) |
239 | 239 | {}
|
240 | 240 | };
|
241 | 241 |
|
@@ -545,7 +545,7 @@ int main(int argc, char* argv[])
|
545 | 545 | for (const auto& port : dpdkPortVec)
|
546 | 546 | {
|
547 | 547 | pcpp::DpdkDevice* dev = pcpp::DpdkDeviceList::getInstance().getDeviceByPort(port);
|
548 |
| - if (dev == NULL) |
| 548 | + if (dev == nullptr) |
549 | 549 | {
|
550 | 550 | EXIT_WITH_ERROR("DPDK device for port " << port << " doesn't exist");
|
551 | 551 | }
|
@@ -581,9 +581,9 @@ int main(int argc, char* argv[])
|
581 | 581 | }
|
582 | 582 | }
|
583 | 583 |
|
584 |
| - // get DPDK device to send packets to (or NULL if doesn't exist) |
| 584 | + // get DPDK device to send packets to (or nullptr if doesn't exist) |
585 | 585 | pcpp::DpdkDevice* sendPacketsTo = pcpp::DpdkDeviceList::getInstance().getDeviceByPort(sendPacketsToPort);
|
586 |
| - if (sendPacketsTo != NULL && !sendPacketsTo->isOpened() && !sendPacketsTo->open()) |
| 586 | + if (sendPacketsTo != nullptr && !sendPacketsTo->isOpened() && !sendPacketsTo->open()) |
587 | 587 | {
|
588 | 588 | EXIT_WITH_ERROR("Could not open port#" << sendPacketsToPort << " for sending matched packets");
|
589 | 589 | }
|
|
0 commit comments