diff options
| author | liuwentan <[email protected]> | 2022-08-10 10:21:07 +0800 |
|---|---|---|
| committer | liuwentan <[email protected]> | 2022-08-10 10:21:07 +0800 |
| commit | e5146a6cbeda57a2b5a95fd906f62a59f727be04 (patch) | |
| tree | cebd0855aa1cd682113119b3049a3b77487804a2 | |
| parent | a93ffa9078634b060d388b0767ac9352d3576163 (diff) | |
[PACKET_IO]format code style
| -rw-r--r-- | src/common/pio_packet_queue.h | 2 | ||||
| -rw-r--r-- | src/packet_io/marsio_mode/pio_marsio.cpp | 5 | ||||
| -rw-r--r-- | src/packet_io/marsio_mode/pio_marsio.h | 16 | ||||
| -rw-r--r-- | src/packet_io/packet_io.h | 12 | ||||
| -rw-r--r-- | src/packet_io/pcap_file_mode/pio_pcap_file.cpp | 8 | ||||
| -rw-r--r-- | src/packet_io/pcap_file_mode/pio_pcap_file.h | 6 | ||||
| -rw-r--r-- | src/packet_io/pcap_live_mode/pio_pcap_live.h | 6 |
7 files changed, 25 insertions, 30 deletions
diff --git a/src/common/pio_packet_queue.h b/src/common/pio_packet_queue.h index 970bc02..d4f3583 100644 --- a/src/common/pio_packet_queue.h +++ b/src/common/pio_packet_queue.h @@ -31,7 +31,7 @@ * * custom zone: user can set custom field * pkt_payload: received packet data -**/ + */ struct pio_packet { /* pkt header pointer */ void *pkt_hdr; diff --git a/src/packet_io/marsio_mode/pio_marsio.cpp b/src/packet_io/marsio_mode/pio_marsio.cpp index 73c9f31..fdbcc82 100644 --- a/src/packet_io/marsio_mode/pio_marsio.cpp +++ b/src/packet_io/marsio_mode/pio_marsio.cpp @@ -390,11 +390,6 @@ static int marsio_instance_init(struct packet_io_instance *pinst) return 0; } -/* - * @brief create packet_io marsio instance - * - * @param: pinst(in/out) - */ int pio_marsio_instance_create(struct packet_io_instance *pinst) { if (nullptr == pinst) { diff --git a/src/packet_io/marsio_mode/pio_marsio.h b/src/packet_io/marsio_mode/pio_marsio.h index f10e160..dd436e0 100644 --- a/src/packet_io/marsio_mode/pio_marsio.h +++ b/src/packet_io/marsio_mode/pio_marsio.h @@ -17,7 +17,7 @@ /** * @brief dll is short for dynamic link lib * the following entries is supported by marsio system -**/ + */ struct marsio_dll_function_entries { struct mr_instance *(*marsio_create)(void); @@ -88,7 +88,7 @@ struct pio_marsio_instance_context { * if marsio device receive packets, use mr_dev_handle * @mr_sendpath_handle: marsio sendpath handle * if marsio device send packets, both mr_dev_handle and sendpath are required -**/ + */ struct pio_marsio_device_context { struct mr_vdev *mr_dev_handle; struct mr_sendpath * mr_sendpath_handle; @@ -118,12 +118,12 @@ void pio_marsio_instance_destroy(struct packet_io_instance *pinst); * pdev->dev_name: the name of marsio device, such as eth1, eth2, ... * pdev->rxq_num: number of the packet receiving queues for the device * pdev->txq_num: number of the packet sending queues for the device -**/ + */ int pio_marsio_device_open(struct packet_io_device *pdev); -/* +/** * @brief close pcap_live device -**/ + */ int pio_marsio_device_close(struct packet_io_device *pdev); /** @@ -135,7 +135,7 @@ int pio_marsio_device_close(struct packet_io_device *pdev); * @param nr_pkts: number of packets expected to receive * * @retval number of packets actually received -*/ + */ int pio_marsio_device_receive(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts); /** @@ -147,7 +147,7 @@ int pio_marsio_device_receive(struct packet_io_device *pdev, uint32_t rxq_id, st * @param nr_pkts: number of packets expected to send * * @retval if ret<0, means the sending fails; if ret==0 means the sending succeeds -*/ + */ int pio_marsio_device_send(struct packet_io_device *pdev, uint32_t txq_id, struct packet **pkts, int nr_pkts); /** @@ -157,7 +157,7 @@ int pio_marsio_device_send(struct packet_io_device *pdev, uint32_t txq_id, struc * @param qid: * @param pkts: * @param nr_pkts: -*/ + */ void pio_marsio_device_pkt_free(struct packet_io_device *pdev, uint32_t qid, struct packet **pkts, int nr_pkts); void *pio_marsio_device_buff_ctrlzone(struct packet *p); diff --git a/src/packet_io/packet_io.h b/src/packet_io/packet_io.h index 9c58192..ce66aa6 100644 --- a/src/packet_io/packet_io.h +++ b/src/packet_io/packet_io.h @@ -23,7 +23,7 @@ * note: * 1. packet_io_XXX function is supported by packet_io.h * 2. pio_XXX function is supported by pio_pcap_live.h/pio_pcap_file.h/pio_marsio.h -**/ + */ struct pio_instance_operations { int (*create)(struct packet_io_instance *pinst); @@ -104,7 +104,7 @@ struct packet_io_device { * * @param instance_name: packet_io instance name * @param mode: packet_io run mode -**/ + */ struct packet_io_instance * packet_io_instance_create(const char *instance_name, const enum packet_io_run_mode mode); @@ -118,7 +118,7 @@ void packet_io_instance_destroy(struct packet_io_instance *pinst); * @param dev_name: packet_io device name * @param nr_rxq: number of receive queue for the device * @param nr_txq: number of send queue for the device -**/ + */ struct packet_io_device * packet_io_device_open(struct packet_io_instance *pinst, const char *dev_name, uint32_t nr_rxq, uint32_t nr_txq); @@ -132,7 +132,7 @@ void packet_io_device_close(struct packet_io_device *dev); * @param rxq_id: which queue will receive from * @param p: received packet's pointer array * @param nr_p: number of received packets -**/ + */ int packet_io_device_rx(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts); /** @@ -142,12 +142,12 @@ int packet_io_device_rx(struct packet_io_device *pdev, uint32_t rxq_id, struct p * @param rxq_id: which queue will send to * @param p: prepare to send packet's pointer array * @param nr_p: number of packets which prepare to send -**/ + */ int packet_io_device_tx(struct packet_io_device *pdev, uint32_t txq_id, struct packet **pkts, int nr_pkts); /* * @brief packet_io free packet buff -**/ + */ void packet_io_pkts_free(struct packet_io_device *pdev, uint32_t qid, struct packet **pkts, int nr_pkts); /** diff --git a/src/packet_io/pcap_file_mode/pio_pcap_file.cpp b/src/packet_io/pcap_file_mode/pio_pcap_file.cpp index d84f227..edf0a9a 100644 --- a/src/packet_io/pcap_file_mode/pio_pcap_file.cpp +++ b/src/packet_io/pcap_file_mode/pio_pcap_file.cpp @@ -22,13 +22,13 @@ #include "../../../sdk/include/logger.h" #include "../../common/time_helper.h" -/* +/** * @brief validate path is a valid plain file or directory * * @retval failed (-1) successful (0), * if success, dir == nullptr <---> means path is plain file * dir != nullptr <---> means path is directory -**/ + */ static int validate_directory_or_file(const char *path, DIR **dir) { DIR *temp_dir = nullptr; @@ -58,11 +58,11 @@ static int validate_directory_or_file(const char *path, DIR **dir) return ret; } -/* +/** * @brief get the timestamp of the first packet and rewind * * @retval true(success), false(error) -*/ + */ static bool peek_first_packet_timestamp(struct pcap_plain_file_info *pfile_info) { int ret = pcap_next_ex(pfile_info->pcap_handle, &pfile_info->first_pkt_hdr, diff --git a/src/packet_io/pcap_file_mode/pio_pcap_file.h b/src/packet_io/pcap_file_mode/pio_pcap_file.h index 498cda6..af9ec4f 100644 --- a/src/packet_io/pcap_file_mode/pio_pcap_file.h +++ b/src/packet_io/pcap_file_mode/pio_pcap_file.h @@ -79,7 +79,7 @@ struct pcap_file_directory_info { /** * @brief pio_pcap_file_device_context - pcap file device context -**/ + */ struct pio_pcap_file_device_context { union { struct pcap_file_directory_info *dir; @@ -119,12 +119,12 @@ void pio_pcap_file_instance_destroy(struct packet_io_instance *pinst); * pdev->dev_name: the name of pcap file * pdev->rxq_num: number of the packet receiving queues for the device * pdev->txq_num: number of the packet sending queues for the device -**/ + */ int pio_pcap_file_device_open(struct packet_io_device *pdev); /** * @brief close pcap_live device -**/ + */ int pio_pcap_file_device_close(struct packet_io_device *pdev); int pio_pcap_file_device_receive(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts); diff --git a/src/packet_io/pcap_live_mode/pio_pcap_live.h b/src/packet_io/pcap_live_mode/pio_pcap_live.h index 02bf4cc..40810de 100644 --- a/src/packet_io/pcap_live_mode/pio_pcap_live.h +++ b/src/packet_io/pcap_live_mode/pio_pcap_live.h @@ -25,7 +25,7 @@ struct pio_pcap_live_instance_context { /** * @brief pio_pcap_file_device_context - pcap file device context -**/ + */ struct pio_pcap_live_device_context { pcap_t *pcap_handle; @@ -79,12 +79,12 @@ void pio_pcap_live_instance_destroy(struct packet_io_instance *pinst); * pdev->dev_name: the name of pcap device, such as eth1, eth2, ... * pdev->rxq_num: number of the packet receiving queues for the device * pdev->txq_num: number of the packet sending queues for the device -**/ + */ int pio_pcap_live_device_open(struct packet_io_device *pdev); /** * @brief close pcap_live device -**/ + */ int pio_pcap_live_device_close(struct packet_io_device *pdev); int pio_pcap_live_device_receive(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts); |
