summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/lib
AgeCommit message (Collapse)AuthorFilesLines
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-7/+0
trajectory trace has been broken for a while because we used to save the buffer trajectory in a vector pointed to in opaque2. This does not work well when opaque2 is copied (eg. because of a clone) as 2 buffers end up sharing the same vector. This dedicates a full cacheline in the buffer metadata instead when trajectory is compiled in. No dynamic allocation, no sharing, no tears. Type: refactor Change-Id: I6a028ca1b48d38f393a36979e5e452c2dd48ad3f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-04-28nat: fix byte order on ipfix message fieldsMatthew Smith1-3/+6
Type: fix The code for quota exceeded events is a u32 and was being copied into ipfix packets in host byte order. Same for the limit field. Swap the order before copying into packet buffer. This change was applied once before but had to be reverted. This was because between the time the change was uploaded/reviewed and the time it was merged, a different patch was merged which activated a NAT ipfix unit test that had formerly only been run as part of the extended tests. The test was expecting the values to be in host byte order so it failed with this patch applied. This time around, that test has also been updated to expect network byte order. Change-Id: If5413b1f806d664f6786e56ba13c3eee573c26d2 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion1-6/+6
Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-15nat: remove unused parameterKlement Sekera1-9/+9
Type: refactor Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: Ifb4a9c52fd2c5dd9f3f5cf41214aa1851f6d7acd
2021-02-24nat: Final NAT44 EI/ED split patchFilip Varga5-1/+380
This patch achieves complete separation of endpoint-dependent and endpoint-independent IPv4 NAT features. Some common stuff is also moved to NAT library. Type: refactor Change-Id: I52468b7e2b5ac28958a2baf8e2ea01787322e801 Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-12-13nat: revert 'fix byte order on ipfix message fields'Damjan Marion1-6/+3
This reverts commit bfba2d555331ce67f707e608877e96dbd2aacd80. Reason for revert: breaks test test_nat44.TestNAT44.test_ipfix_max_sessions Change-Id: I6eed4d02835ab792e7e3491fc14240cc88a86710 Type: fix Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-11nat: fix byte order on ipfix message fieldsMatthew Smith1-3/+6
Type: fix The code for quota exceeded events is a u32 and was being copied into ipfix packets in host byte order. Same for the limit field. Swap the order before copying into packet buffer. Change-Id: I881766e1c52acc9bebde38d85228fa492214ee21 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-12-02nat: use correct per-thread vlib_mainBenoît Ganne1-8/+8
Using vlib_main of another thread is prohibited. Type: fix Change-Id: I9a85a5fee5c6665d423b4306faf3b3f2c5e22f99 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-11-13nat: cleanup & reorganizationFilip Varga5-1/+393
Fixed compatibility issue between nat ei and nat ed modes. Moved nat syslogging to nat librarry. Deprecating apis that will be integrated in upcoming candidate configuration patch. Type: refactor Change-Id: I334b1b05b81b74667c5c76a05f768442e0dcf7e8 Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-11-12nat: use table ID for nat44 ipfix session eventsMatthew Smith2-7/+10
Type: fix IPfix messages about NAT44 session create/delete were being populated with the FIB table index instead of the table ID. The table ID is the correct identifier to report externally (NAT64 IPfix messages for BIB and session create/delete use table ID, as does NAT syslogging). Convert the table index to an ID before adding it to the IPfix NAT44 session create/delete message data. Change-Id: I0166384752b17ff3a8c55aa19fa2af7a8140791e Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-11-05nat: fix byte order of vrf_id in loggingAlexander Chernavin1-0/+3
Type: fix Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: I9930a2a90caa78e848fe657ab2da863467be41ea
2020-10-21misc: minimize dependencies on udp.hFlorin Coras2-0/+4
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id13f33843b230a1d169560742c4f7b2dc17d8718
2020-10-09nat: ipfix logging separation & refactorFilip Varga2-0/+1776
Type: refactor Change-Id: I8785e4987e4f60361072440d0c3c6954c9c12394 Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-10-07nat: move nat64 to a subfeatureFilip Varga2-1/+53
Type: refactor Change-Id: I3b9e17164647d2019b1f40cffeed63393345219e Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-06-03nat: refactor mss_clamping to not depend on snat_main_tOle Troan1-0/+66
Type: refactor Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I1110e425859a4f1f07952c91b50f263cb7323836
2020-05-22nat: fix dslite session port allocationVladimir Ratnikov1-4/+4
Fix allocation of port per dslite session. After each session is created per protocol, when new one should be created with new port, instead it's trying to create with the same port and while(1) loop is executed forever and VPP does not response Type: fix Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com> Change-Id: Ic91b8b07253498ef9846ca60bcd4c4c76a5fac91
2020-05-13nat: perf improvement - replace branchy codeKlement Sekera2-24/+31
Use a lookup table instead. Type: improvement Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: Ia8461099828bb8824bf016201f135e6b69c444d1
2020-03-11nat: dslite plugin separationFilip Varga4-25/+124
Type: refactor Signed-off-by: Filip Varga <fivarga@cisco.com> Change-Id: I81546423200cc7f8a06b527dac8ead191a9e0519
2020-02-04nat: pool allocation function fixFilip Varga1-1/+1
Type: fix Change-Id: I75b20db66fb58e1724a212253c51315836079f4b Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-01-17nat: refactor of port/address allocation functionsFilip Varga2-0/+389
Change-Id: Ie2a3c0f44322dd8415603b7ce51bb72d72769c95 Ticket: VPP-1815 Type: refactor Signed-off-by: Filip Varga <fivarga@cisco.com>