summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipfix-export/flow_api.c
AgeCommit message (Collapse)AuthorFilesLines
2021-11-29ipfix-export: don't check the result of pool_getPaul Atkins1-2/+0
The code to check the exp is set after the call to pool_get() is marked as unreachable in coverity. This is becasue if it fails in pool_get then the it panics. Remove the unreachable code. Type: fix Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: Iabb51b6b6788b6c12ef37c28dde2118c798de831
2021-11-22ipfix-export: Change exp to use ip_addressPaul Atkins1-40/+37
Modify the ipfix_exporter to use ip_address instead of the ipv4 specific version. Modify the current code so that it writes into the v4 specific part of the address, i.e. we are not yet fully supporting IPv6. For the exporter configured via the original API (the one that is always in slot0) we will not support IPv6 addresses. Type: improvement Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: Ic9854ac62aaee76a7a55a958234c456fd9828c4c
2021-11-22ipfix-export: Add APIs to get/send buffersPaul Atkins1-0/+5
The ipfix exporter should be doing most of the work of building packets and sending them rather than leaving every client of the exporter to do all the work themselves. Start to move towards that by adding APIs to get and send buffers. Store the state of this in new per thread data on the report so that we can send with minimal use of atomics. We do need an atomic for the sequence number in the packet though as that contains the number of data_records sent for the 'stream', not just for a single core. As the state is stored on the flow_report_t the caller needs to know which report they are using, so add a field to the args struct used to create the report that is used to pass back the report index on success. Type: improvement Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: I222b98a3f0326b3b71b11e0866a8c9736bed6dc1
2021-11-22ipfix-export: add a new API to dump all exportersPaul Atkins1-0/+51
Add a new API to dump all the exporters. As the destination struct type is not the same as for the existing dump/details API no attempt is made to use the existing code to populate the structure. Type: improvement Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: I409f80285b107a530e0e4f3c6a047a803815a0ec
2021-11-22ipfix-export: support creating multiple exportersPaul Atkins1-4/+77
The existing api set_ipfix_exporter only allows for the creation of a single exporter. In some cases it is desirable to export data to multiple different destinations. Allow users to create multiple ipfix exporters to support this. Add a new api that allows for the creation of multiple exporters, and store them in a pool of exporters. The exporter created by the old API will always be in index 0 of the pool. Exporters created by the new API will be given the next available index in the pool, and will return this index to the API caller so that they can track the exporter they created. The collector_address is the key for the exporter, so changes can be made by doing a further call to the API with the same collector_address. Type: improvement Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: Id71c98cffcf8d141d890b40fb90a40b90a91d1d6
2021-11-22ipfix-export: refactor ipfix_exporter_t_handler fnPaul Atkins1-34/+34
Split this api handler into 2 parts. The first is the top level handler and the second is the internal helper function that does all the work. This is in preparation for having a similar API that allows multiple exporters to exist at the same time. Type: refactor Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: Ibd4037682742f4c2f52b4cd1346d35fb2029461d
2021-11-22ipfix-export: pass an exp to flow_report_add_delPaul Atkins1-3/+5
Pass an ipfix_exporter to this function so that callers can choose which exporter they are modifying. Type: improvement Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: Ice0ed19a57baf15b1dc85cd27fe01913e36d7f4f
2021-11-22ipfix-export: refactor fields in flow_report_mainPaul Atkins1-18/+20
Pull out the fields in flow_report_main_t that are specific to a single exporter and move them into a new structure that represents an exporter. Add a pool of exporters to flow_report_main_t and do a pool_get() to get the entry at index 0, so that the existing users of the code need only change the path at which they access the old fields and have no need to make further code changes. In functions that were accessing the fields that now make up the ipfix_exporter create a local var that points to the first (always valid) exporter and use this as the base for the fields rather than finding them from flow_report_main. This is in preparation for supporting multiple flow_exporters. Note that at the moment the code supports multiple 'streams' for a given exporter, where each stream has its own source port, domain id and template space. But all streams within an exporter have the same destination address, so this is not the same as multiple exporters. Type: refactor Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: I49f5c7fb9e901773351d31dc8a59178c37e99301
2021-11-17ipfix-export: set msg id correctly for dump msgPaul Atkins1-1/+2
When sending the reply to the VL_API_IPFIX_EXPORTER_DUMP message the message id has to be added to the message base. Type: fix Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: I9565be7887046739b5f309e021f34ed75c9e370e
2021-06-21misc: ipfix api cleanupFilip Tehlar1-56/+8
Use autogenerated code. Does not change API definitions. Type: improvement Change-Id: I864979ce490651bf1f5fed107620e9bc4ca4bf93 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-12-08misc: fix api in ipfix_classify_table_add/detailsAlexander Chernavin1-4/+4
In ipfix_classify_table_add_del and ipfix_classify_table_details the ip_version field has vl_api_address_family_t type. However, there is no encode/decode for the field in the IPFIX API. Moreover, the IPFIX code expects the field to contain raw 4 or 6 to indicate the IP version. With this change, encode/decode the ip_version field in the IPFIX API. Also, stop converting transport_protocol between host and network byte order because it's u8. Type: fix Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: I4051756b8077b4367dd779cb555a34f74f6d7a9d
2020-10-21misc: minimize dependencies on udp.hFlorin Coras1-0/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id13f33843b230a1d169560742c4f7b2dc17d8718
2020-10-01misc: allow disabling of ipfix exporter via apiAlexander Chernavin1-7/+1
Zero collector address indicates that the IPFIX exporter is disabled. You can zero the collector address via vppctl but you can't do it via the API because the handler returns an error if the address is zero. With this change, do not return an error in the handler when the collector address is zero thus allowing the IPFIX exporter be disabled. Type: fix Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: I1335c0d06af81f11d743c395399a360c612c0c21
2019-12-10api: multiple connections per processDave Barach1-1/+1
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-10-22ip: ipfix-export API updateJakub Grajciar1-10/+24
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I5b03e5de111c3a3b8da4e9f02cba0aa99e3ee9f3
2019-06-24api: implement ipfix_flushPaul Vinciguerra1-2/+32
-Migrate tests to api and cleanup: '# FIXME this should be an API call' in tests. Type: feature Change-Id: I715f9f8acc0f2af9c974ea221b2aea46692a6218 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-04-08fixing typosJim Thompson1-1/+1
Change-Id: I215e1e0208a073db80ec6f87695d734cf40fabe3 Signed-off-by: Jim Thompson <jim@netgate.com>
2018-10-23c11 safe string handling supportDave Barach1-4/+4
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-05-04Flow: Rename IPFIX exporter.Ole Troan1-0/+396
Change-Id: I9363cf54b73f7cfd8622af6f1cb250438ea0d3b6 Signed-off-by: Ole Troan <ot@cisco.com>