Name: service/network/suricata Summary: Network analysis and threat detection software Publisher: solaris Version: 8.0.2 Build Release: 11.4 Branch: 11.4.90.0.0.212.0 Packaging Date: Wed Dec 17 21:22:11 2025 Size: 269.99 MB Compressed Size: 67.85 MB FMRI: pkg://solaris/service/network/suricata@8.0.2,11.4-11.4.90.0.0.212.0:20251217T212211Z License: ## Files: COPYING LICENSE rust/suricatasc/LICENSE suricata-update/LICENSE GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ## Files: rust/vendor/build_const/LICENSE.txt rust/vendor/nibble_vec/LICENSE rust/vendor/nix/LICENSE rust/vendor/radix_trie/LICENSE The MIT License (MIT) Copyright (c) 2015 Carl Lerche + nix-rust Authors Copyright (c) 2015 Michael Sproul Copyright (c) 2017 Garrett Berg, vitiral@gmail.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/cdylib-link-lines/LICENSE rust/vendor/fs_extra/LICENSE rust/vendor/lru/LICENSE rust/vendor/lzma-rs/LICENSE rust/vendor/psl-types/LICENSE rust/vendor/psl/LICENSE rust/vendor/test-case-core/LICENSE rust/vendor/test-case-macros/LICENSE rust/vendor/test-case/LICENSE MIT License Copyright (c) 2016 Jerome Froelich Copyright (c) 2016 Rushmore Mushambi Copyright (c) 2017 - 2018 Guillaume Endignoux Copyright (c) 2017 Denis Kurilenko Copyright (c) 2017 Marcin Sas-Szymański Copyright (c) 2019 Luca Barbato Copyright (c) 2021 Rushmore Mushambi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/cfg_aliases/LICENSE MIT License Copyright (c) 2020 Katharos Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/data-encoding/LICENSE rust/vendor/generic-array/LICENSE rust/vendor/nu-ansi-term/LICENSE rust/vendor/tracing-core/src/spin/LICENSE The MIT License (MIT) Copyright (c) 2014 Benjamin Sago Copyright (c) 2014 Mathijs van de Nes Copyright (c) 2015 Bartłomiej Kamiński Copyright (c) 2015-2020 Julien Cretin Copyright (c) 2017-2020 Google Inc. Copyright (c) 2021-2022 The Nushell Project Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/endian-type/LICENSE The MIT License (MIT) Copyright (c) 2015 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/enum_primitive/LICENSE Copyright (c) 2015 Anders Kaseorg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/error-code/LICENSE Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/miniz_oxide/LICENSE MIT License Copyright 2013-2014 RAD Game Tools and Valve Software Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC Copyright (c) 2017 Frommi Copyright (c) 2017-2024 oyvindln Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/nom/LICENSE Copyright (c) 2014-2019 Geoffroy Couprie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/regex/src/testdata/LICENSE The following license covers testregex.c and all associated test data. Permission is hereby granted, free of charge, to any person obtaining a copy of THIS SOFTWARE FILE (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following disclaimer: THIS SOFTWARE IS PROVIDED BY AT&T ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AT&T BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: rust/vendor/rustyline/LICENSE The MIT License (MIT) Copyright (c) 2015 Katsu Kawakami & Rustyline authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/sawp/LICENSE Copyright 2020 Crown Copyright, Government of Canada (Canadian Centre for Cyber Security / Communications Security Establishment) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/sharded-slab/LICENSE Copyright (c) 2019 Eliza Weisman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/slab/LICENSE rust/vendor/tracing-attributes/LICENSE rust/vendor/tracing-core/LICENSE rust/vendor/tracing-log/LICENSE rust/vendor/tracing-subscriber/LICENSE rust/vendor/tracing/LICENSE Copyright (c) 2019 Carl Lerche Copyright (c) 2019 Tokio Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/vendor/synstructure-0.12.6/LICENSE rust/vendor/synstructure/LICENSE Copyright 2016 Nika Layzell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/htp/LICENSE Copyright (c) 2009-2010 Open Information Security Foundation Copyright (c) 2010-2013 Qualys, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Qualys, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: rust/vendor/alloc-no-stdlib/LICENSE rust/vendor/brotli-decompressor/LICENSE Copyright (c) 2016 Dropbox, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: rust/vendor/minimal-lexical/LICENSE.md Minimal-lexical is dual licensed under the Apache 2.0 license as well as the MIT license. See the LICENCE-MIT and the LICENCE-APACHE files for the licenses. --- `src/bellerophon.rs` is loosely based off the Golang implementation, found [here](https://github.com/golang/go/blob/b10849fbb97a2244c086991b4623ae9f32c212d0/src/strconv/extfloat.go). That code (used if the `compact` feature is enabled) is subject to a [3-clause BSD license](https://github.com/golang/go/blob/b10849fbb97a2244c086991b4623ae9f32c212d0/LICENSE): Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: README.md # Suricata [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/suricata.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:suricata) [![codecov](https://codecov.io/gh/OISF/suricata/branch/main/graph/badge.svg?token=QRyyn2BSo1)](https://codecov.io/gh/OISF/suricata) ## Introduction [Suricata](https://suricata.io) is a network IDS, IPS and NSM engine developed by the [OISF](https://oisf.net) and the Suricata community. ## Resources - [Home Page](https://suricata.io) - [Bug Tracker](https://redmine.openinfosecfoundation.org/projects/suricata) - [User Guide](https://docs.suricata.io) - [Dev Guide](https://docs.suricata.io/en/latest/devguide/index.html) - [Installation Guide](https://docs.suricata.io/en/latest/install.html) - [User Support Forum](https://forum.suricata.io) ## Contributing We're happily taking patches and other contributions. Please see our [Contribution Process](https://docs.suricata.io/en/latest/devguide/contributing/contribution-process.html) for how to get started. Suricata is a complex piece of software dealing with mostly untrusted input. Mishandling this input will have serious consequences: * in IPS mode a crash may knock a network offline * in passive mode a compromise of the IDS may lead to loss of critical and confidential data * missed detection may lead to undetected compromise of the network In other words, we think the stakes are pretty high, especially since in many common cases the IDS/IPS will be directly reachable by an attacker. For this reason, we have developed a QA process that is quite extensive. A consequence is that contributing to Suricata can be a somewhat lengthy process. On a high level, the steps are: 1. GitHub-CI based checks. This runs automatically when a pull request is made. 2. Review by devs from the team and community 3. QA runs from private QA setups. These are private due to the nature of the test traffic. ### Overview of Suricata's QA steps OISF team members are able to submit builds to our private QA setup. It will run a series of build tests and a regression suite to confirm no existing features break. The final QA runs takes a few hours minimally, and generally runs overnight. It currently runs: - extensive build tests on different OS', compilers, optimization levels, configure features - static code analysis using cppcheck, scan-build - runtime code analysis using valgrind, AddressSanitizer, LeakSanitizer - regression tests for past bugs - output validation of logging - unix socket testing - pcap based fuzz testing using ASAN and LSAN - traffic replay based IDS and IPS tests Next to these tests, based on the type of code change further tests can be run manually: - traffic replay testing (multi-gigabit) - large pcap collection processing (multi-terabytes) - fuzz testing (might take multiple days or even weeks) - pcap based performance testing - live performance testing - various other manual tests based on evaluation of the proposed changes It's important to realize that almost all of the tests above are used as acceptance tests. If something fails, it's up to you to address this in your code. One step of the QA is currently run post-merge. We submit builds to the Coverity Scan program. Due to limitations of this (free) service, we can submit once a day max. Of course it can happen that after the merge the community will find issues. For both cases we request you to help address the issues as they may come up. ## FAQ __Q: Will you accept my PR?__ A: That depends on a number of things, including the code quality. With new features it also depends on whether the team and/or the community think the feature is useful, how much it affects other code and features, the risk of performance regressions, etc. __Q: When will my PR be merged?__ A: It depends, if it's a major feature or considered a high risk change, it will probably go into the next major version. __Q: Why was my PR closed?__ A: As documented in the [Suricata GitHub workflow](https://docs.suricata.io/en/latest/devguide/contributing/github-pr-workflow.html), we expect a new pull request for every change. Normally, the team (or community) will give feedback on a pull request after which it is expected to be replaced by an improved PR. So look at the comments. If you disagree with the comments we can still discuss them in the closed PR. If the PR was closed without comments it's likely due to QA failure. If the GitHub-CI checks failed, the PR should be fixed right away. No need for a discussion about it, unless you believe the QA failure is incorrect. __Q: The compiler/code analyser/tool is wrong, what now?__ A: To assist in the automation of the QA, we're not accepting warnings or errors to stay. In some cases this could mean that we add a suppression if the tool supports that (e.g. valgrind, DrMemory). Some warnings can be disabled. In some exceptional cases the only 'solution' is to refactor the code to work around a static code checker limitation false positive. While frustrating, we prefer this over leaving warnings in the output. Warnings tend to get ignored and then increase risk of hiding other warnings. __Q: I think your QA test is wrong__ A: If you really think it is, we can discuss how to improve it. But don't come to this conclusion too quickly, more often it's the code that turns out to be wrong. __Q: Do you require signing of a contributor license agreement?__ A: Yes, we do this to keep the ownership of Suricata in one hand: the Open Information Security Foundation. See http://suricata.io/about/open-source/ and http://suricata.io/about/contribution-agreement/ ## Files: examples/plugins/c-json-filetype/README.md # Example EVE Filetype Plugin ## Building If in the Suricata source directory, this plugin can be built by running `make`. ## Building Standalone This Makefile is not generated by automake so it can serve as an example for plugins created outside of the Suricata source tree. Building a standalone plugin has the following dependencies: - Suricata is installed - The Suricata library is installed: `make install-library` - The Suricata development headers are installed: `make install-headers` - The program `libsuricata-config` is in your path (installed with `make install-library`) Modify the Makefile to use `libsuricata-config`. Before building this plugin you will need to build and install Suricata from the git main branch and install the development tools and headers: - `make install-library` - `make install-headers` then make sure the newly installed tool `libsuricata-config` can be found in your path, for example: ``` libsuricata-config --cflags ``` Then a simple `make` should build this plugin. Or if the Suricata installation is not in the path, a command like the following can be used: ``` PATH=/opt/suricata/bin:$PATH make ``` ## Usage To run the plugin, first add the path to the plugin you just compiled to your `suricata.yaml`, for example: ``` plugins: - /usr/lib/suricata/plugins/json-filetype.so ``` Then add an output for the plugin: ``` outputs: - eve-log: enabled: yes filetype: json-filetype-plugin threaded: true types: - dns - tls - http ``` In the example above we use the name specified in the plugin as the `filetype` and specify that all `dns`, `tls` and `http` log entries should be sent to the plugin. ## Details This plugin demonstrates a Suricata JSON/EVE output plugin (file-type). The idea of a Suricata EVE output plugin is to provide a file like interface for the handling of rendered JSON logs. This is useful for custom destinations not builtin to Suricata or if the formatted JSON requires some post-processing. Note: EVE output plugins are not that useful just for reformatting the JSON output as the plugin does need to handle writing to a file once the file type has been delegated to the plugin. ### Registering a Plugin All Suricata plugins make themselves known to Suricata by using a function named `SCPluginRegister` which is called after Suricata loads the plugin shared object file. This function must return a `SCPlugin` struct which contains basic information about the plugin. For example: ```c const SCPlugin PluginRegistration = { .name = "eve-filetype", .author = "Jason Ish", .license = "GPLv2", .Init = TemplateInit, }; const SCPlugin *SCPluginRegister() { return &PluginRegistration; } ``` ### Initializing a Plugin After the plugin has been registered, the `Init` callback will be called. This is where the plugin will set itself up as a specific type of plugin such as an EVE output, or a capture method. This plugins registers itself as an EVE file type using the `SCRegisterEveFileType` struct. To register as an EVE file type the following must be provided: * name: This is the name of the output which will be used in the eve filetype field in `suricata.yaml` to enable this output. * Init: The callback called when the output is "opened". * Deinit: The callback called the output is "closed". * ThreadInit: Callback called to initialize per thread data (if threaded). * ThreadDeinit: Callback called to deinitialize per thread data (if threaded). * Write: The callback called when an EVE record is to be "written". Please see the code in `filetype.c` for more details about this functions. ## Files: rust/htp/README.md # LibHTP --- Copyright 2009-2010 Open Information Security Foundation Copyright 2010-2013 Qualys, Inc. --- LibHTP is a security-aware parser for the HTTP protocol and the related bits and pieces. The goal of the project is mainly to support the Suricata use case. Other use cases might not be fully supported, and we encourage you to cover these. See the LICENSE file distributed with this work for information regarding licensing, copying and copyright ownership. # Usage Start using libHTP by including it in your project's `Cargo.toml` dependencies. The base library will also be required for using common types. **The minimum supported version of `rustc` is `1.58.1`.** ## Example ``` [dependencies] htp = "2.0.0" ``` ## FFI Support LibHTP has a foreign function interface for use in C/C++ projects. FFI Support can be enabled by building with the `cbindgen` feature. ``` # Install cbindgen which is required to generate headers cargo install --force cbindgen # Build headers and shared objects make ``` ## LICENSE LibHTP is licensed under the BSD 3-Clause license (also known as "BSD New" and "BSD Simplified".) The complete text of the license is enclosed in the file LICENSE. ## Files: rust/vendor/adler2/README.md # Adler-32 checksums for Rust This is a fork of the adler crate as the [original](https://github.com/jonas-schievink/adler) has been archived and is no longer updated by it's author [![crates.io](https://img.shields.io/crates/v/adler.svg)](https://crates.io/crates/adler) [![docs.rs](https://docs.rs/adler/badge.svg)](https://docs.rs/adler/) ![CI](https://github.com/jonas-schievink/adler/workflows/CI/badge.svg) This crate provides a simple implementation of the Adler-32 checksum, used in the zlib compression format. Please refer to the [changelog](CHANGELOG.md) to see what changed in the last releases. ## Features - Permissively licensed (0BSD) clean-room implementation. - Zero dependencies. - Zero `unsafe`. - Decent performance (3-4 GB/s) (see note). - Supports `#![no_std]` (with `default-features = false`). ## Usage Add an entry to your `Cargo.toml`: ```toml [dependencies] adler2 = "2.0.0" ``` Check the [API Documentation](https://docs.rs/adler/) for how to use the crate's functionality. ## Rust version support Currently, this crate supports all Rust versions starting at Rust 1.56.0. Bumping the Minimum Supported Rust Version (MSRV) is *not* considered a breaking change, but will not be done without good reasons. The latest 3 stable Rust versions will always be supported no matter what. ## Performance Due to the way the algorithm works this crate and the fact that it's not possible to use explicit simd in safe rust currently, this crate benefits drastically from being compiled with newer cpu instructions enabled (using e.g ```RUSTFLAGS=-C target-feature'+sse4.1``` or ```-C target-cpu=x86-64-v2```/```-C target-cpu=x86-64-v3``` arguments depending on what cpu support is being targeted.) Judging by the crate benchmarks, on a Ryzen 5600, compiling with SSE 4.1 (enabled in x86-64-v2 feature level) enabled can give a ~50-150% speedup, enabling the LZCNT instruction (enabled in x86-64-v3 feature level) can give a further ~50% speedup, ## Files: rust/vendor/aead/README.md # RustCrypto: Authenticated Encryption with Additional Data Traits [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] This crate provides an abstract interface for [AEAD] ciphers, which guarantee both confidentiality and integrity, even from a powerful attacker who is able to execute [chosen-ciphertext attacks]. The resulting security property, [ciphertext indistinguishability], is considered a basic requirement for modern cryptographic implementations. See [RustCrypto/AEADs] for cipher implementations which use this trait. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/aead.svg [crate-link]: https://crates.io/crates/aead [docs-image]: https://docs.rs/aead/badge.svg [docs-link]: https://docs.rs/aead/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260038-AEADs [build-image]: https://github.com/RustCrypto/traits/workflows/aead/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/traits/actions?query=workflow%3Aaead [//]: # (general links) [AEAD]: https://en.wikipedia.org/wiki/Authenticated_encryption [chosen-ciphertext attacks]: https://en.wikipedia.org/wiki/Chosen-ciphertext_attack [ciphertext indistinguishability]: https://en.wikipedia.org/wiki/Ciphertext_indistinguishability [RustCrypto/AEADs]: https://github.com/RustCrypto/AEADs ## Files: rust/vendor/aes/README.md # RustCrypto: Advanced Encryption Standard (AES) [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] [![Downloads][downloads-image]][crate-link] [![HAZMAT][hazmat-image]][hazmat-link] Pure Rust implementation of the [Advanced Encryption Standard (AES)][1]. This crate implements the low-level AES block function, and is intended for use for implementing higher-level constructions *only*. It is NOT intended for direct use in applications. [Documentation][docs-link] ## Security ### ⚠️ Warning: [Hazmat!][hazmat-link] This crate does not ensure ciphertexts are authentic (i.e. by using a MAC to verify ciphertext integrity), which can lead to serious vulnerabilities if used incorrectly! To avoid this, use an [AEAD][2] mode based on AES, such as [AES-GCM][3] or [AES-GCM-SIV][4]. See the [RustCrypto/AEADs][5] repository for more information. USE AT YOUR OWN RISK! ### Notes This crate has received one [security audit by NCC Group][6], with no significant findings. We would like to thank [MobileCoin][7] for funding the audit. All implementations contained in the crate are designed to execute in constant time, either by relying on hardware intrinsics (i.e. AES-NI on x86/x86_64), or using a portable implementation based on bitslicing. ## Minimum Supported Rust Version Rust **1.49** or higher. Minimum supported Rust version can be changed in future releases, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/aes.svg [crate-link]: https://crates.io/crates/aes [docs-image]: https://docs.rs/aes/badge.svg [docs-link]: https://docs.rs/aes/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.49+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260039-block-ciphers [build-image]: https://github.com/RustCrypto/block-ciphers/workflows/aes/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/block-ciphers/actions?query=workflow%3Aaes [downloads-image]: https://img.shields.io/crates/d/aes.svg [hazmat-image]: https://img.shields.io/badge/crypto-hazmat%E2%9A%A0-red.svg [hazmat-link]: https://github.com/RustCrypto/meta/blob/master/HAZMAT.md [//]: # (general links) [1]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard [2]: https://en.wikipedia.org/wiki/Authenticated_encryption [3]: https://github.com/RustCrypto/AEADs/tree/master/aes-gcm [4]: https://github.com/RustCrypto/AEADs/tree/master/aes-gcm-siv [5]: https://github.com/RustCrypto/AEADs [6]: https://research.nccgroup.com/2020/02/26/public-report-rustcrypto-aes-gcm-and-chacha20poly1305-implementation-review/ [7]: https://www.mobilecoin.com/ ## Files: rust/vendor/aes-gcm/README.md # RustCrypto: AES-GCM [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Crates.io Downloads][downloads-image]][crate-link] [![Build Status][build-image]][build-link] Pure Rust implementation of the AES-GCM [Authenticated Encryption with Associated Data (AEAD)][1] cipher. [Documentation][docs-link] ## Security Notes This crate has received one [security audit by NCC Group][2], with no significant findings. We would like to thank [MobileCoin][3] for funding the audit. All implementations contained in the crate are designed to execute in constant time, either by relying on hardware intrinsics (i.e. AES-NI and CLMUL on x86/x86_64), or using a portable implementation which is only constant time on processors which implement constant-time multiplication. It is not suitable for use on processors with a variable-time multiplication operation (e.g. short circuit on multiply-by-zero / multiply-by-one, such as certain 32-bit PowerPC CPUs and some non-ARM microcontrollers). ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/aes-gcm.svg [crate-link]: https://crates.io/crates/aes-gcm [docs-image]: https://docs.rs/aes-gcm/badge.svg [docs-link]: https://docs.rs/aes-gcm/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.49+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260038-AEADs [downloads-image]: https://img.shields.io/crates/d/aes-gcm.svg [build-image]: https://github.com/RustCrypto/AEADs/workflows/aes-gcm/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/AEADs/actions [//]: # (general links) [1]: https://en.wikipedia.org/wiki/Authenticated_encryption [2]: https://research.nccgroup.com/2020/02/26/public-report-rustcrypto-aes-gcm-and-chacha20poly1305-implementation-review/ [3]: https://www.mobilecoin.com/ ## Files: rust/vendor/aho-corasick/COPYING rust/vendor/byteorder/COPYING rust/vendor/memchr/COPYING This project is dual-licensed under the Unlicense and MIT licenses. You may use this code under the terms of either license. ## Files: rust/vendor/aho-corasick/README.md aho-corasick ============ A library for finding occurrences of many patterns at once with SIMD acceleration in some cases. This library provides multiple pattern search principally through an implementation of the [Aho-Corasick algorithm](https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm), which builds a finite state machine for executing searches in linear time. Features include case insensitive matching, overlapping matches, fast searching via SIMD and optional full DFA construction and search & replace in streams. [![Build status](https://github.com/BurntSushi/aho-corasick/workflows/ci/badge.svg)](https://github.com/BurntSushi/aho-corasick/actions) [![crates.io](https://img.shields.io/crates/v/aho-corasick.svg)](https://crates.io/crates/aho-corasick) Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/). ### Documentation https://docs.rs/aho-corasick ### Usage Add this to your `Cargo.toml`: ```toml [dependencies] aho-corasick = "0.7" ``` ### Example: basic searching This example shows how to search for occurrences of multiple patterns simultaneously. Each match includes the pattern that matched along with the byte offsets of the match. ```rust use aho_corasick::AhoCorasick; let patterns = &["apple", "maple", "Snapple"]; let haystack = "Nobody likes maple in their apple flavored Snapple."; let ac = AhoCorasick::new(patterns); let mut matches = vec![]; for mat in ac.find_iter(haystack) { matches.push((mat.pattern(), mat.start(), mat.end())); } assert_eq!(matches, vec![ (1, 13, 18), (0, 28, 33), (2, 43, 50), ]); ``` ### Example: case insensitivity This is like the previous example, but matches `Snapple` case insensitively using `AhoCorasickBuilder`: ```rust use aho_corasick::AhoCorasickBuilder; let patterns = &["apple", "maple", "snapple"]; let haystack = "Nobody likes maple in their apple flavored Snapple."; let ac = AhoCorasickBuilder::new() .ascii_case_insensitive(true) .build(patterns); let mut matches = vec![]; for mat in ac.find_iter(haystack) { matches.push((mat.pattern(), mat.start(), mat.end())); } assert_eq!(matches, vec![ (1, 13, 18), (0, 28, 33), (2, 43, 50), ]); ``` ### Example: replacing matches in a stream This example shows how to execute a search and replace on a stream without loading the entire stream into memory first. ```rust use aho_corasick::AhoCorasick; let patterns = &["fox", "brown", "quick"]; let replace_with = &["sloth", "grey", "slow"]; // In a real example, these might be `std::fs::File`s instead. All you need to // do is supply a pair of `std::io::Read` and `std::io::Write` implementations. let rdr = "The quick brown fox."; let mut wtr = vec![]; let ac = AhoCorasick::new(patterns); ac.stream_replace_all(rdr.as_bytes(), &mut wtr, replace_with) .expect("stream_replace_all failed"); assert_eq!(b"The slow grey sloth.".to_vec(), wtr); ``` ### Example: finding the leftmost first match In the textbook description of Aho-Corasick, its formulation is typically structured such that it reports all possible matches, even when they overlap with another. In many cases, overlapping matches may not be desired, such as the case of finding all successive non-overlapping matches like you might with a standard regular expression. Unfortunately the "obvious" way to modify the Aho-Corasick algorithm to do this doesn't always work in the expected way, since it will report matches as soon as they are seen. For example, consider matching the regex `Samwise|Sam` against the text `Samwise`. Most regex engines (that are Perl-like, or non-POSIX) will report `Samwise` as a match, but the standard Aho-Corasick algorithm modified for reporting non-overlapping matches will report `Sam`. A novel contribution of this library is the ability to change the match semantics of Aho-Corasick (without additional search time overhead) such that `Samwise` is reported instead. For example, here's the standard approach: ```rust use aho_corasick::AhoCorasick; let patterns = &["Samwise", "Sam"]; let haystack = "Samwise"; let ac = AhoCorasick::new(patterns); let mat = ac.find(haystack).expect("should have a match"); assert_eq!("Sam", &haystack[mat.start()..mat.end()]); ``` And now here's the leftmost-first version, which matches how a Perl-like regex will work: ```rust use aho_corasick::{AhoCorasickBuilder, MatchKind}; let patterns = &["Samwise", "Sam"]; let haystack = "Samwise"; let ac = AhoCorasickBuilder::new() .match_kind(MatchKind::LeftmostFirst) .build(patterns); let mat = ac.find(haystack).expect("should have a match"); assert_eq!("Samwise", &haystack[mat.start()..mat.end()]); ``` In addition to leftmost-first semantics, this library also supports leftmost-longest semantics, which match the POSIX behavior of a regular expression alternation. See `MatchKind` in the docs for more details. ### Minimum Rust version policy This crate's minimum supported `rustc` version is `1.41.1`. The current policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if `crate 1.0` requires Rust 1.20.0, then `crate 1.0.z` for all values of `z` will also require Rust 1.20.0 or newer. However, `crate 1.y` for `y > 0` may require a newer minimum version of Rust. In general, this crate will be conservative with respect to the minimum supported version of Rust. ### FFI bindings * [G-Research/ahocorasick_rs](https://github.com/G-Research/ahocorasick_rs/) is a Python wrapper for this library. ### Future work Here are some plans for the future: * Assuming the current API is sufficient, I'd like to commit to it and release a `1.0` version of this crate some time in the next 6-12 months. * Support stream searching with leftmost match semantics. Currently, only standard match semantics are supported. Getting this right seems possible, but is tricky since the match state needs to be propagated through multiple searches. (With standard semantics, as soon as a match is seen the search ends.) ## Files: rust/vendor/allocator-api2/README.md # allocator-api2 [![crates](https://img.shields.io/crates/v/allocator-api2.svg?style=for-the-badge&label=allocator-api2)](https://crates.io/crates/allocator-api2) [![docs](https://img.shields.io/badge/docs.rs-allocator--api2-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white)](https://docs.rs/allocator-api2) [![actions](https://img.shields.io/github/actions/workflow/status/zakarumych/allocator-api2/badge.yml?branch=main&style=for-the-badge)](https://github.com/zakarumych/allocator-api2/actions/workflows/badge.yml) [![MIT/Apache](https://img.shields.io/badge/license-MIT%2FApache-blue.svg?style=for-the-badge)](COPYING) ![loc](https://img.shields.io/tokei/lines/github/zakarumych/allocator-api2?style=for-the-badge) This crate mirrors types and traits from Rust's unstable [`allocator_api`] The intention of this crate is to serve as substitution for actual thing for libs when build on stable and beta channels. The target users are library authors who implement allocators or collection types that use allocators, or anyone else who wants using [`allocator_api`] The crate should be frequently updated with minor version bump. When [`allocator_api`] is stable this crate will get version `1.0` and simply re-export from `core`, `alloc` and `std`. The code is mostly verbatim copy from rust repository. Mostly attributes are removed. ## Usage This paragraph describes how to use this crate correctly to ensure compatibility and interoperability on both stable and nightly channels. If you are writing a library that interacts with allocators API, you can add this crate as a dependency and use the types and traits from this crate instead of the ones in `core` or `alloc`. This will allow your library to compile on stable and beta channels. Your library *MAY* provide a feature that will enable "allocator-api2/nightly". When this feature is enabled, your library *MUST* enable unstable `#![feature(allocator_api)]` or it may not compile. If feature is not provided, your library may not be compatible with the rest of the users and cause compilation errors on nightly channel when some other crate enables "allocator-api2/nightly" feature. # Minimal Supported Rust Version (MSRV) This crate is guaranteed to compile on stable Rust 1.63 and up. A feature "fresh-rust" bumps the MSRV to unspecified higher version, but should be compatible with at least few latest stable releases. The feature enables some additional functionality: * `CStr` without "std" feature ## License Licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contributions Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [`allocator_api`]: https://doc.rust-lang.org/unstable-book/library-features/allocator-api.html ## Files: rust/vendor/anstyle/README.md # anstyle > ANSI text styling *A portmanteau of "ansi style"* [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] ![License](https://img.shields.io/crates/l/anstyle.svg) [![Crates Status](https://img.shields.io/crates/v/anstyle.svg)](https://crates.io/crates/anstyle) `anstyle` provides core types describing [ANSI styling escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) for interoperability between crates. For example, this would allow a crate to provide an API for customizing the colors used without putting the underlying text styling crate in the API. For integration with your text styling crate, see: - [anstyle-termcolor](crates/termcolor) - [anstyle-owo-colors](crates/owo) - [anstyle-yansi](crates/yansi) General utilities: - [anstyle-git](crates/git): Parse Git style descriptions ## License Licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) * MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. ## [Contribute](../../CONTRIBUTING.md) Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions. [Crates.io]: https://crates.io/crates/anstyle [Documentation]: https://docs.rs/anstyle ## Files: rust/vendor/asn1-rs-0.6.2/README.md rust/vendor/asn1-rs/README.md [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![docs.rs](https://docs.rs/asn1-rs/badge.svg)](https://docs.rs/asn1-rs) [![crates.io](https://img.shields.io/crates/v/asn1-rs.svg)](https://crates.io/crates/asn1-rs) [![Download numbers](https://img.shields.io/crates/d/asn1-rs.svg)](https://crates.io/crates/asn1-rs) [![Github CI](https://github.com/rusticata/asn1-rs/workflows/Continuous%20integration/badge.svg)](https://github.com/rusticata/asn1-rs/actions) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.63.0+-lightgray.svg)](#rust-version-requirements) # BER/DER Parsers/Encoders A set of parsers/encoders for Basic Encoding Rules (BER [[X.690]]) and Distinguished Encoding Rules(DER [[X.690]]) formats, implemented with the [nom] parser combinator framework. It is written in pure Rust, fast, and makes extensive use of zero-copy. A lot of care is taken to ensure security and safety of this crate, including design (recursion limit, defensive programming), tests, and fuzzing. It also aims to be panic-free. This crate is a rewrite of [der-parser](https://crates.io/crates/der-parser) to propose a more data-oriented API, and add generalized support for serialization. Many ideas were borrowed from the [crypto/utils/der](https://github.com/RustCrypto/utils/tree/master/der) crate (like the `Any`/`TryFrom`/`FromDer` mechanism), adapted and merged into a generalized BER/DER crate. Credits (and many thanks) go to Tony Arcieri for writing the original crate. # BER/DER parsers BER stands for Basic Encoding Rules, and is defined in [[X.690]]. It defines a set of rules to encode and decode ASN.1 [[X.680]] objects in binary. [[X.690]] also defines Distinguished Encoding Rules (DER), which is BER with added rules to ensure canonical and unequivocal binary representation of objects. The choice of which one to use is usually guided by the speficication of the data format based on BER or DER: for example, X.509 uses DER as encoding representation. The main traits for parsing are the [`FromBer`] and [`FromDer`] traits. These traits provide methods to parse binary input, and return either the remaining (unparsed) bytes and the parsed object, or an error. The parsers follow the interface from [nom], and the [`ParseResult`] object is a specialized version of `nom::IResult`. This means that most `nom` combinators (`map`, `many0`, etc.) can be used in combination to objects and methods from this crate. Reading the nom documentation may help understanding how to write and combine parsers and use the output. **Minimum Supported Rust Version**: 1.63.0 # Recipes See [doc::recipes] and [doc::derive] for more examples and recipes. See [doc::debug] for advice and tools to debug parsers. ## Examples Parse 2 BER integers: ```rust use asn1_rs::{Integer, FromBer}; let bytes = [ 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; let (rem, obj1) = Integer::from_ber(&bytes).expect("parsing failed"); let (rem, obj2) = Integer::from_ber(&bytes).expect("parsing failed"); assert_eq!(obj1, Integer::from_u32(65537)); ``` In the above example, the generic [`Integer`] type is used. This type can contain integers of any size, but do not provide a simple API to manipulate the numbers. In most cases, the integer either has a limit, or is expected to fit into a primitive type. To get a simple value, just use the `from_ber`/`from_der` methods on the primitive types: ```rust use asn1_rs::FromBer; let bytes = [ 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; let (rem, obj1) = u32::from_ber(&bytes).expect("parsing failed"); let (rem, obj2) = u32::from_ber(&rem).expect("parsing failed"); assert_eq!(obj1, 65537); assert_eq!(obj2, 65536); ``` If the parsing succeeds, but the integer cannot fit into the expected type, the method will return an `IntegerTooLarge` error. # BER/DER encoders BER/DER encoding is symmetrical to decoding, using the traits `ToBer` and [`ToDer`] traits. These traits provide methods to write encoded content to objects with the `io::Write` trait, or return an allocated `Vec` with the encoded data. If the serialization fails, an error is returned. ## Examples Writing 2 BER integers: ```rust use asn1_rs::{Integer, ToDer}; let mut writer = Vec::new(); let obj1 = Integer::from_u32(65537); let obj2 = Integer::from_u32(65536); let _ = obj1.write_der(&mut writer).expect("serialization failed"); let _ = obj2.write_der(&mut writer).expect("serialization failed"); let bytes = &[ 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; assert_eq!(&writer, bytes); ``` Similarly to `FromBer`/`FromDer`, serialization methods are also implemented for primitive types: ```rust use asn1_rs::ToDer; let mut writer = Vec::new(); let _ = 65537.write_der(&mut writer).expect("serialization failed"); let _ = 65536.write_der(&mut writer).expect("serialization failed"); let bytes = &[ 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; assert_eq!(&writer, bytes); ``` If the parsing succeeds, but the integer cannot fit into the expected type, the method will return an `IntegerTooLarge` error. ## Changes See `CHANGELOG.md`. # References - [[X.680]] Abstract Syntax Notation One (ASN.1): Specification of basic notation. - [[X.690]] ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER). [X.680]: http://www.itu.int/rec/T-REC-X.680/en "Abstract Syntax Notation One (ASN.1): Specification of basic notation." [X.690]: https://www.itu.int/rec/T-REC-X.690/en "ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)." [nom]: https://github.com/Geal/nom "Nom parser combinator framework" ## Changes See `CHANGELOG.md`, and `UPGRADING.md` for instructions for upgrading major versions. ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/autocfg/README.md autocfg ======= [![autocfg crate](https://img.shields.io/crates/v/autocfg.svg)](https://crates.io/crates/autocfg) [![autocfg documentation](https://docs.rs/autocfg/badge.svg)](https://docs.rs/autocfg) ![minimum rustc 1.0](https://img.shields.io/badge/rustc-1.0+-red.svg) ![build status](https://github.com/cuviper/autocfg/workflows/master/badge.svg) A Rust library for build scripts to automatically configure code based on compiler support. Code snippets are dynamically tested to see if the `rustc` will accept them, rather than hard-coding specific version support. ## Usage Add this to your `Cargo.toml`: ```toml [build-dependencies] autocfg = "1" ``` Then use it in your `build.rs` script to detect compiler features. For example, to test for 128-bit integer support, it might look like: ```rust extern crate autocfg; fn main() { let ac = autocfg::new(); ac.emit_has_type("i128"); // (optional) We don't need to rerun for anything external. autocfg::rerun_path("build.rs"); } ``` If the type test succeeds, this will write a `cargo:rustc-cfg=has_i128` line for Cargo, which translates to Rust arguments `--cfg has_i128`. Then in the rest of your Rust code, you can add `#[cfg(has_i128)]` conditions on code that should only be used when the compiler supports it. ## Release Notes - 1.4.0 (2024-09-26) - Add `emit_possibility` for Rust 1.80's [checked cfgs], and call that automatically for methods that conditionally `emit`, by @Techcable. [checked cfgs]: https://blog.rust-lang.org/2024/05/06/check-cfg.html - 1.3.0 (2024-05-03) - Add `probe_raw` for direct control of the code that will be test-compiled. - Use wrappers when querying the `rustc` version information too. - 1.2.0 (2024-03-25) - Add `no_std` and `set_no_std` to control the use of `#![no_std]` in probes. - Use `RUSTC_WRAPPER` and `RUSTC_WORKSPACE_WRAPPER` when they are set. - 1.1.0 (2022-02-07) - Use `CARGO_ENCODED_RUSTFLAGS` when it is set. - 1.0.1 (2020-08-20) - Apply `RUSTFLAGS` for more `--target` scenarios, by @adamreichold. - 1.0.0 (2020-01-08) - 🎉 Release 1.0! 🎉 (no breaking changes) - Add `probe_expression` and `emit_expression_cfg` to test arbitrary expressions. - Add `probe_constant` and `emit_constant_cfg` to test arbitrary constant expressions. - 0.1.7 (2019-10-20) - Apply `RUSTFLAGS` when probing `$TARGET != $HOST`, mainly for sysroot, by @roblabla. - 0.1.6 (2019-08-19) - Add `probe`/`emit_sysroot_crate`, by @leo60228. - 0.1.5 (2019-07-16) - Mask some warnings from newer rustc. - 0.1.4 (2019-05-22) - Relax `std`/`no_std` probing to a warning instead of an error. - Improve `rustc` bootstrap compatibility. - 0.1.3 (2019-05-21) - Auto-detects if `#![no_std]` is needed for the `$TARGET`. - 0.1.2 (2019-01-16) - Add `rerun_env(ENV)` to print `cargo:rerun-if-env-changed=ENV`. - Add `rerun_path(PATH)` to print `cargo:rerun-if-changed=PATH`. ## Minimum Rust version policy This crate's minimum supported `rustc` version is `1.0.0`. Compatibility is its entire reason for existence, so this crate will be extremely conservative about raising this requirement. If this is ever deemed necessary, it will be treated as a major breaking change for semver purposes. ## License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. ## Files: rust/vendor/base64/README.md # [base64](https://crates.io/crates/base64) [![](https://img.shields.io/crates/v/base64.svg)](https://crates.io/crates/base64) [![Docs](https://docs.rs/base64/badge.svg)](https://docs.rs/base64) [![CircleCI](https://circleci.com/gh/marshallpierce/rust-base64/tree/master.svg?style=shield)](https://circleci.com/gh/marshallpierce/rust-base64/tree/master) [![codecov](https://codecov.io/gh/marshallpierce/rust-base64/branch/master/graph/badge.svg)](https://codecov.io/gh/marshallpierce/rust-base64) [![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) Made with CLion. Thanks to JetBrains for supporting open source! It's base64. What more could anyone want? This library's goals are to be *correct* and *fast*. It's thoroughly tested and widely used. It exposes functionality at multiple levels of abstraction so you can choose the level of convenience vs performance that you want, e.g. `decode_engine_slice` decodes into an existing `&mut [u8]` and is pretty fast (2.6GiB/s for a 3 KiB input), whereas `decode_engine` allocates a new `Vec` and returns it, which might be more convenient in some cases, but is slower (although still fast enough for almost any purpose) at 2.1 GiB/s. See the [docs](https://docs.rs/base64) for all the details. ## FAQ ### I need to decode base64 with whitespace/null bytes/other random things interspersed in it. What should I do? Remove non-base64 characters from your input before decoding. If you have a `Vec` of base64, [retain](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain) can be used to strip out whatever you need removed. If you have a `Read` (e.g. reading a file or network socket), there are various approaches. - Use [iter_read](https://crates.io/crates/iter-read) together with `Read`'s `bytes()` to filter out unwanted bytes. - Implement `Read` with a `read()` impl that delegates to your actual `Read`, and then drops any bytes you don't want. ### I need to line-wrap base64, e.g. for MIME/PEM. [line-wrap](https://crates.io/crates/line-wrap) does just that. ### I want canonical base64 encoding/decoding. First, don't do this. You should no more expect Base64 to be canonical than you should expect compression algorithms to produce canonical output across all usage in the wild (hint: they don't). However, [people are drawn to their own destruction like moths to a flame](https://eprint.iacr.org/2022/361), so here we are. There are two opportunities for non-canonical encoding (and thus, detection of the same during decoding): the final bits of the last encoded token in two or three token suffixes, and the `=` token used to inflate the suffix to a full four tokens. The trailing bits issue is unavoidable: with 6 bits available in each encoded token, 1 input byte takes 2 tokens, with the second one having some bits unused. Same for two input bytes: 16 bits, but 3 tokens have 18 bits. Unless we decide to stop shipping whole bytes around, we're stuck with those extra bits that a sneaky or buggy encoder might set to 1 instead of 0. The `=` pad bytes, on the other hand, are entirely a self-own by the Base64 standard. They do not affect decoding other than to provide an opportunity to say "that padding is incorrect". Exabytes of storage and transfer have no doubt been wasted on pointless `=` bytes. Somehow we all seem to be quite comfortable with, say, hex-encoded data just stopping when it's done rather than requiring a confirmation that the author of the encoder could count to four. Anyway, there are two ways to make pad bytes predictable: require canonical padding to the next multiple of four bytes as per the RFC, or, if you control all producers and consumers, save a few bytes by requiring no padding (especially applicable to the url-safe alphabet). All `Engine` implementations must at a minimum support treating non-canonical padding of both types as an error, and optionally may allow other behaviors. ## Rust version compatibility The minimum supported Rust version is 1.48.0. # Contributing Contributions are very welcome. However, because this library is used widely, and in security-sensitive contexts, all PRs will be carefully scrutinized. Beyond that, this sort of low level library simply needs to be 100% correct. Nobody wants to chase bugs in encoding of any sort. All this means that it takes me a fair amount of time to review each PR, so it might take quite a while to carve out the free time to give each PR the attention it deserves. I will get to everyone eventually! ## Developing Benchmarks are in `benches/`. ```bash cargo bench ``` ## no_std This crate supports no_std. By default the crate targets std via the `std` feature. You can deactivate the `default-features` to target `core` instead. In that case you lose out on all the functionality revolving around `std::io`, `std::error::Error`, and heap allocations. There is an additional `alloc` feature that you can activate to bring back the support for heap allocations. ## Profiling On Linux, you can use [perf](https://perf.wiki.kernel.org/index.php/Main_Page) for profiling. Then compile the benchmarks with `cargo bench --no-run`. Run the benchmark binary with `perf` (shown here filtering to one particular benchmark, which will make the results easier to read). `perf` is only available to the root user on most systems as it fiddles with event counters in your CPU, so use `sudo`. We need to run the actual benchmark binary, hence the path into `target`. You can see the actual full path with `cargo bench -v`; it will print out the commands it runs. If you use the exact path that `bench` outputs, make sure you get the one that's for the benchmarks, not the tests. You may also want to `cargo clean` so you have only one `benchmarks-` binary (they tend to accumulate). ```bash sudo perf record target/release/deps/benchmarks-* --bench decode_10mib_reuse ``` Then analyze the results, again with perf: ```bash sudo perf annotate -l ``` You'll see a bunch of interleaved rust source and assembly like this. The section with `lib.rs:327` is telling us that 4.02% of samples saw the `movzbl` aka bit shift as the active instruction. However, this percentage is not as exact as it seems due to a phenomenon called *skid*. Basically, a consequence of how fancy modern CPUs are is that this sort of instruction profiling is inherently inaccurate, especially in branch-heavy code. ```text lib.rs:322 0.70 : 10698: mov %rdi,%rax 2.82 : 1069b: shr $0x38,%rax : if morsel == decode_tables::INVALID_VALUE { : bad_byte_index = input_index; : break; : }; : accum = (morsel as u64) << 58; lib.rs:327 4.02 : 1069f: movzbl (%r9,%rax,1),%r15d : // fast loop of 8 bytes at a time : while input_index < length_of_full_chunks { : let mut accum: u64; : : let input_chunk = BigEndian::read_u64(&input_bytes[input_index..(input_index + 8)]); : morsel = decode_table[(input_chunk >> 56) as usize]; lib.rs:322 3.68 : 106a4: cmp $0xff,%r15 : if morsel == decode_tables::INVALID_VALUE { 0.00 : 106ab: je 1090e ``` ## Fuzzing This uses [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz). See `fuzz/fuzzers` for the available fuzzing scripts. To run, use an invocation like these: ```bash cargo +nightly fuzz run roundtrip cargo +nightly fuzz run roundtrip_no_pad cargo +nightly fuzz run roundtrip_random_config -- -max_len=10240 cargo +nightly fuzz run decode_random ``` ## License This project is dual-licensed under MIT and Apache 2.0. ## Files: rust/vendor/bendy/README.md # Bendy [![Build Status](https://travis-ci.org/P3KI/bendy.svg?branch=master)](https://travis-ci.org/P3KI/bendy) [![Current Version](https://meritbadge.herokuapp.com/bendy)](https://crates.io/crates/bendy) [![License: BSD-3-Clause](https://img.shields.io/github/license/P3KI/bendy.svg)](https://github.com/P3KI/bendy/blob/master/LICENSE-BSD3) A Rust library for encoding and decoding bencode with enforced canonicalization rules. [Bencode](https://en.wikipedia.org/wiki/Bencode) is a simple but very effective encoding scheme, originating with the BitTorrent peer-to-peer system. --- You may be looking for: - [Known Alternatives](#known-alternatives) - [Why should I use it](#why-should-i-use-it) - [Usage](#usage) - [Encoding](#encoding-with-tobencode) - [Decoding](#decoding-with-frombencode) - [Unsafe Code](#usage-of-unsafe-code) - [Contributing](#contributing) --- ## Known alternatives: This is not the first library to implement Bencode. In fact there's several implementations already: - Toby Padilla [serde-bencode](https://github.com/toby/serde-bencode) - Arjan Topolovec's [rust-bencode](https://github.com/arjantop/rust-bencode), - Murarth's [bencode](https://github.com/murarth/bencode), - and Jonas Hermsmeier's [rust-bencode](https://github.com/jhermsmeier/rust-bencode) ## Why should I use it? So why the extra work adding yet-another-version of a thing that already exists, you might ask? ### Enforced correctness Implementing a canonical encoding form is straight forward. It comes down to defining *a proper way of handling unordered data*. The next step is that bendy's sorting data before encoding it using the regular Bencode rules. If your data is already sorted bendy will of course skip the extra sorting step to gain efficiency. But bendy goes a step further to *ensure correctness*: If you hand the library data that you say is already sorted, bendy still does an in-place verification to *ensure that your data actually is sorted* and complains if it isn't. In the end, once bendy serialized your data, it's Bencode through and through. So it's perfectly compatible with every other Bencode library. Just remember: At this point *only bendy* enforces the correctness of the canonical format if you read it back in. ### Canonical representation Bendy ensures that any de-serialize / serialize round trip produces the exact *same* and *correct* binary representation. This is relevant if you're dealing with unordered sets or map-structured data where theoretically the order is not relevant, but in practice it is, especially if you want to ensure that cryptographic signatures related to the data structure do not get invalidated accidentally. | Data Structure | Default Impl | Comment | |----------------|--------------|--------------------------------------------------------------------------------------------| | Vec | ✔ | Defines own ordering | | VecDeque | ✔ | Defines own ordering | | LinkedList | ✔ | Defines own ordering | | HashMap | ✔ | Ordering missing but content is ordered by key byte representation. | | BTreeMap | ✔ | Defines own ordering | | HashSet | ✘ | (Unordered) Set handling not yet defined | | BTreeSet | ✘ | (Unordered) Set handling not yet defined | | BinaryHeap | ✘ | Ordering missing | | Iterator | ~ | `emit_unchecked_list()` allows to emit any iterable but user needs to ensure the ordering. | **Attention:** - Since most list types already define their inner ordering, data structures like `Vec`, `VecDeque`, and `LinkedList` will not get sorted during encoding! - There is no default implementation for handling generic iterators. This is by design. `Bendy` cannot tell from an iterator whether the underlying structure requires sorting or not and would have to take data as-is. ## Usage First you need to add bendy as a project dependency: ```toml [dependencies] bendy = "^0.3" ``` ### Encoding with `ToBencode` To encode an object of a type which already implements the `ToBencode` trait it is enough to import the trait and call the `to_bencode()` function on the object. ```rust use bendy::encoding::{ToBencode, Error}; fn main() {} #[test] fn encode_vector() -> Result<(), Error> { let my_data = vec!["hello", "world"]; let encoded = my_data.to_bencode()?; assert_eq!(b"l5:hello5:worlde", encoded.as_slice()); Ok(()) } ``` ### Implementing `ToBencode` In most cases it should be enough to overwrite the associated `encode` function and keep the default implementation of `to_bencode`. The function will provide you with a `SingleItemEncoder` which must be used to emit any relevant components of the current object. As long as these implement `ToBencode` themselves it is enough to pass them into the `emit` function of the encoder as this will serialize any type implementing the trait. Next to `emit` the encoder also provides a list of functions to encode specific bencode primitives (i.e. `emit_int` and `emit_str`) and nested bencode elements (i.e. `emit_dict` and `emit_list`). These methods should be used if its necessary to output a specific non default data type. **Implementing Integer Encoding** As bencode has native integer support bendy provides default implementations for all of rusts native integer types. This allows to call `to_bencode` on any integer object and to pass these objects into the encoder's `emit_int` function. ```rust use bendy::encoding::{ToBencode, SingleItemEncoder, Error}; struct IntegerWrapper(i64); impl ToBencode for IntegerWrapper { const MAX_DEPTH: usize = 0; fn encode(&self, encoder: SingleItemEncoder) -> Result<(), Error> { encoder.emit_int(self.0) } } fn main() {} #[test] fn encode_integer() -> Result<(), Error> { let example = IntegerWrapper(21); let encoded = example.to_bencode()?; assert_eq!(b"i21e", encoded.as_slice()); let encoded = 21.to_bencode()?; assert_eq!(b"i21e", encoded.as_slice()); Ok(()) } ``` **Encode a byte string** Another data type bencode natively supports are byte strings. Therefore bendy provides default implementations for `String` and `&str`. ```rust use bendy::encoding::{ToBencode, SingleItemEncoder, Error}; struct StringWrapper(String); impl ToBencode for StringWrapper { const MAX_DEPTH: usize = 0; fn encode(&self, encoder: SingleItemEncoder) -> Result<(), Error> { encoder.emit_str(&self.0) } } fn main() {} #[test] fn encode_string() -> Result<(), Error> { let example = StringWrapper("content".to_string()); let encoded = example.to_bencode()?; assert_eq!(b"7:content", encoded.as_slice()); let encoded = "content".to_bencode()?; assert_eq!(b"7:content", encoded.as_slice()); Ok(()) } ``` As its a very common pattern to represent a byte string as `Vec` bendy exposes the `AsString` wrapper. This can be used to encapsulate any element implementing `AsRef<[u8]>` to output itself as a bencode string instead of a list. ```rust use bendy::encoding::{ToBencode, SingleItemEncoder, Error, AsString}; struct ByteStringWrapper(Vec); impl ToBencode for ByteStringWrapper { const MAX_DEPTH: usize = 0; fn encode(&self, encoder: SingleItemEncoder) -> Result<(), Error> { let content = AsString(&self.0); encoder.emit(&content) } } fn main() {} #[test] fn encode_byte_string() -> Result<(), Error> { let example = ByteStringWrapper(b"content".to_vec()); let encoded = example.to_bencode()?; assert_eq!(b"7:content", encoded.as_slice()); let encoded = AsString(b"content").to_bencode()?; assert_eq!(b"7:content", encoded.as_slice()); Ok(()) } ``` **Encode a dictionary** If a data structure contains key-value pairs its most likely a good idea to encode it as a bencode dictionary. This is also true for most structs with more then one member as it might be helpful to represent their names to ensure the existence of specific (optional) member. __Attention:__ To ensure a canonical representation bendy requires that the keys of a dictionary emitted via `emit_dict` are sorted in ascending order or the encoding will fail with an error of kind `UnsortedKeys`. In case of an unsorted dictionary it might be useful to use `emit_and_sort_dict` instead. ```rust use bendy::encoding::{ToBencode, SingleItemEncoder, Error}; struct Example { label: String, counter: u64, } impl ToBencode for Example { const MAX_DEPTH: usize = 1; fn encode(&self, encoder: SingleItemEncoder) -> Result<(), Error> { encoder.emit_dict(|mut e| { e.emit_pair(b"counter", &self.counter)?; e.emit_pair(b"label", &self.label)?; Ok(()) }) } } fn main() {} #[test] fn encode_dictionary() -> Result<(), Error> { let example = Example { label: "Example".to_string(), counter: 0 }; let encoded = example.to_bencode()?; assert_eq!(b"d7:counteri0e5:label7:Examplee", encoded.as_slice()); Ok(()) } ``` **Encode a list** While encoding a list bendy assumes the elements inside this list are inherently sorted through their position inside the list. The implementation is therefore free to choose its own sorting. ```rust use bendy::encoding::{ToBencode, SingleItemEncoder, Error}; struct Location(i64, i64); impl ToBencode for Location { const MAX_DEPTH: usize = 1; fn encode(&self, encoder: SingleItemEncoder) -> Result<(), Error> { encoder.emit_list(|e| { e.emit_int(self.0)?; e.emit_int(self.1) }) } } fn main() {} #[test] fn encode_list() -> Result<(), Error> { let example = Location(2, 3); let encoded = example.to_bencode()?; assert_eq!(b"li2ei3ee", encoded.as_slice()); Ok(()) } ``` ### Decoding with `FromBencode` To decode an object of a type which already implements the `FromBencode` trait it is enough to import the trait and call the `from_bencode()` function on the object. ```rust use bendy::decoding::{FromBencode, Error}; fn main() {} #[test] fn decode_vector() -> Result<(), Error> { let encoded = b"l5:hello5:worlde".to_vec(); let decoded = Vec::::from_bencode(&encoded)?; assert_eq!(vec!["hello", "world"], decoded); Ok(()) } ``` ### Implementing `FromBencode` In most cases it should be enough to overwrite the associated `decode_bencode_object` function and keep the default implementation of `from_bencode`. The function will provide you with an representation of a bencode `Object` which must be processed to receive any relevant components of the expected data type. As long as these implement `FromBencode` themselves it is enough to call `decode_bencode_object` on the expected data type of the element as this will deserialize any type implementing the trait. Next to `from_bencode` the bencode `Object` representation also provides a list of helper functions to itself into specific bencode primitives and container (i.e. `bytes_or`, `integer_or_else` or `try_into_list`). Which than can be used to restore the actual element. **Decode an integer** As bencode has native integer support bendy provides default implementations for all of rusts native integer types. This allows to call `from_bencode` on any type of integer. *Attention:* If it's necessary to handle a big integer which has no representation through one of the default data types it's always possible to access the string version of the number during decoding. ```rust use bendy::decoding::{FromBencode, Object, Error}; #[derive(Debug, Eq, PartialEq)] struct IntegerWrapper(i64); impl FromBencode for IntegerWrapper { const EXPECTED_RECURSION_DEPTH: usize = 0; fn decode_bencode_object(object: Object) -> Result { // This is an example for content handling. It would also be possible // to call `i64::decode_bencode_object(object)` directly. let content = object.try_into_integer()?; let number = content.parse::()?; Ok(IntegerWrapper(number)) } } fn main() {} #[test] fn decode_integer() -> Result<(), Error> { let encoded = b"i21e".to_vec(); let example = IntegerWrapper::from_bencode(&encoded)?; assert_eq!(IntegerWrapper(21), example); let example = i64::from_bencode(&encoded)?; assert_eq!(21, example); Ok(()) } ``` **Decode a byte string** In most cases it is possible to restore a string from its bencode representation as a byte sequence via the `String::from_utf8` and `str::from_utf8`. ```rust use bendy::decoding::{FromBencode, Object, Error}; #[derive(Debug, Eq, PartialEq)] struct StringWrapper(String); impl FromBencode for StringWrapper { const EXPECTED_RECURSION_DEPTH: usize = 0; fn decode_bencode_object(object: Object) -> Result { // This is an example for content handling. It would also be possible // to call `String::decode_bencode_object(object)` directly. let content = object.try_into_bytes()?; let content = String::from_utf8(content.to_vec())?; Ok(StringWrapper(content)) } } fn main() {} #[test] fn decode_string() -> Result<(), Error> { let encoded = b"7:content".to_vec(); let example = StringWrapper::from_bencode(&encoded)?; assert_eq!(StringWrapper("content".to_string()), example); let example = String::from_bencode(&encoded)?; assert_eq!("content".to_string(), example); Ok(()) } ``` If the content is a non utf8 encoded string or an actual byte sequence the `AsString` wrapper might be useful to restore the bencode string object as a sequence of bytes through an object of type `Vec`. ```rust use bendy::{ decoding::{FromBencode, Object, Error}, encoding::AsString, }; #[derive(Debug, Eq, PartialEq)] struct ByteStringWrapper(Vec); impl FromBencode for ByteStringWrapper { const EXPECTED_RECURSION_DEPTH: usize = 0; fn decode_bencode_object(object: Object) -> Result { let content = AsString::decode_bencode_object(object)?; Ok(ByteStringWrapper(content.0)) } } fn main() {} #[test] fn decode_byte_string() -> Result<(), Error> { let encoded = b"7:content".to_vec(); let example = ByteStringWrapper::from_bencode(&encoded)?; assert_eq!(ByteStringWrapper(b"content".to_vec()), example); let example = AsString::from_bencode(&encoded)?; assert_eq!(b"content".to_vec(), example.0); Ok(()) } ``` **Decode a dictionary** Unwrapping the bencode object into a dictionary will provide a dictionary decoder which can be used to access the included key-value pairs. To improve the error handling in case of huge or multiple nested dictionaries the decoding module provides a `ResultExt` trait which allows to add a context description in case of an error. If multiple context calls are nested they will concatenated in a dot notation like style. ```rust use bendy::decoding::{FromBencode, Object, Error, ResultExt}; #[derive(Debug, Eq, PartialEq)] struct Example { label: String, counter: u64, } impl FromBencode for Example { const EXPECTED_RECURSION_DEPTH: usize = 1; fn decode_bencode_object(object: Object) -> Result { let mut counter = None; let mut label = None; let mut dict = object.try_into_dictionary()?; while let Some(pair) = dict.next_pair()? { match pair { (b"counter", value) => { counter = u64::decode_bencode_object(value) .context("counter") .map(Some)?; }, (b"label", value) => { label = String::decode_bencode_object(value) .context("label") .map(Some)?; }, (unknown_field, _) => { return Err(Error::unexpected_field(String::from_utf8_lossy( unknown_field, ))); }, } } let counter = counter.ok_or_else(|| Error::missing_field("counter"))?; let label= label.ok_or_else(|| Error::missing_field("label"))?; Ok(Example { counter, label }) } } fn main() {} #[test] fn decode_dictionary() -> Result<(), Error> { let encoded = b"d7:counteri0e5:label7:Examplee".to_vec(); let expected = Example { label: "Example".to_string(), counter: 0 }; let example = Example::from_bencode(&encoded)?; assert_eq!(expected, example); Ok(()) } ``` **Decode a list** Unwrapping the bencode object into a list will provide a list decoder which can be used to access the contained elements. ```rust use bendy::decoding::{FromBencode, Object, Error}; #[derive(Debug, PartialEq, Eq)] struct Location(i64, i64); impl FromBencode for Location { const EXPECTED_RECURSION_DEPTH: usize = 1; fn decode_bencode_object(object: Object) -> Result { let mut list = object.try_into_list()?; let x = list.next_object()?.ok_or(Error::missing_field("x"))?; let x = i64::decode_bencode_object(x)?; let y = list.next_object()?.ok_or(Error::missing_field("y"))?; let y = i64::decode_bencode_object(y)?; Ok(Location(x, y)) } } fn main() {} #[test] fn decode_list() -> Result<(), Error> { let encoded = b"li2ei3ee".to_vec(); let expected = Location(2, 3); let example = Location::from_bencode(&encoded)?; assert_eq!(expected, example); Ok(()) } ``` ### Optional: Limitation of recursive parsing **What?** The library allows to set an expected recursion depth limit for de- and encoding. If set, the parser will use this value as an upper limit for the validation of any nested data structure and abort with an error if an additional level of nesting is detected. While the encoding limit itself is primarily there to increase the confidence of bendy users in their own validation code, the decoding limit should be used to avoid parsing of malformed or malicious external data. - The encoding limit can be set through the `MAX_DEPTH` constant in any implementation of the `ToBencode` trait. - The decoding limit can be set through the `EXPECTED_RECURSION_DEPTH` constant in any implementation of the `FromBencode` trait. **How?** The nesting level calculation always starts on level zero, is incremented by one when the parser enters a nested bencode element (i.e. list, dictionary) and decrement as soon as the related element ends. Therefore any values decoded as bencode strings or integers do not affect the nesting limit. ### Serde Support Bendy supports serde when the `serde` feature is enabled: ```toml [dependencies] bendy = { version = "^0.3", features = ["std", "serde"] } serde = { version = "1.0", features = ["derive"] } ``` With the feature enabled, values can be serialized to and deserialized from bencode with `bendy::serde::from_bytes` and `bendy::serde::to_bytes` respectively: ```rust use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, PartialEq, Debug)] struct Foo { bar: String, } fn main() { let value = Foo { bar: "hello".into(), }; let bencode = bendy::serde::to_bytes(&value).unwrap(); assert_eq!(bencode, b"d3:bar5:helloe"); let deserialized = bendy::serde::from_bytes::(&bencode).unwrap(); assert_eq!(deserialized, value); } ``` Information on how Rust types are represented in bencode is available in the [serde module documentation](https://docs.rs/bendy/*/bendy/serde/index.html). ## Usage of unsafe code The parser would not require any unsafe code to work but it still contains a single unsafe call to `str::from_utf8_unchecked`. This call is used to avoid a duplicated UTF-8 check when the parser converts the bytes representing an incoming integer into a `&str` after its successful validation. *Disclaimer: Further unsafe code may be introduced through the dependency on the `failure` crate.* ## Contributing We welcome everyone to ask questions, open issues or provide merge requests. Each merge request will be reviewed and either landed in the main tree or given feedback for changes that would be required. All code in this repository is under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) license. ## Files: rust/vendor/bitflags/README.md bitflags ======== [![Rust](https://github.com/bitflags/bitflags/workflows/Rust/badge.svg)](https://github.com/bitflags/bitflags/actions) [![Latest version](https://img.shields.io/crates/v/bitflags.svg)](https://crates.io/crates/bitflags) [![Documentation](https://docs.rs/bitflags/badge.svg)](https://docs.rs/bitflags) ![License](https://img.shields.io/crates/l/bitflags.svg) `bitflags` generates flags enums with well-defined semantics and ergonomic end-user APIs. You can use `bitflags` to: - provide more user-friendly bindings to C APIs where flags may or may not be fully known in advance. - generate efficient options types with string parsing and formatting support. You can't use `bitflags` to: - guarantee only bits corresponding to defined flags will ever be set. `bitflags` allows access to the underlying bits type so arbitrary bits may be set. - define bitfields. `bitflags` only generates types where set bits denote the presence of some combination of flags. - [Documentation](https://docs.rs/bitflags) - [Specification](https://github.com/bitflags/bitflags/blob/main/spec.md) - [Release notes](https://github.com/bitflags/bitflags/releases) ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] bitflags = "2.9.1" ``` and this to your source code: ```rust use bitflags::bitflags; ``` ## Example Generate a flags structure: ```rust use bitflags::bitflags; // The `bitflags!` macro generates `struct`s that manage a set of flags. bitflags! { /// Represents a set of flags. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] struct Flags: u32 { /// The value `A`, at bit position `0`. const A = 0b00000001; /// The value `B`, at bit position `1`. const B = 0b00000010; /// The value `C`, at bit position `2`. const C = 0b00000100; /// The combination of `A`, `B`, and `C`. const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); } } fn main() { let e1 = Flags::A | Flags::C; let e2 = Flags::B | Flags::C; assert_eq!((e1 | e2), Flags::ABC); // union assert_eq!((e1 & e2), Flags::C); // intersection assert_eq!((e1 - e2), Flags::A); // set difference assert_eq!(!e2, Flags::A); // set complement } ``` ## Rust Version Support The minimum supported Rust version is documented in the `Cargo.toml` file. This may be bumped in minor releases as necessary. ## Files: rust/vendor/bitflags-1.3.2/README.md bitflags ======== [![Rust](https://github.com/bitflags/bitflags/workflows/Rust/badge.svg)](https://github.com/bitflags/bitflags/actions) [![Join the chat at https://gitter.im/bitflags/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bitflags/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge) [![Latest version](https://img.shields.io/crates/v/bitflags.svg)](https://crates.io/crates/bitflags) [![Documentation](https://docs.rs/bitflags/badge.svg)](https://docs.rs/bitflags) ![License](https://img.shields.io/crates/l/bitflags.svg) A Rust macro to generate structures which behave like a set of bitflags - [Documentation](https://docs.rs/bitflags) - [Release notes](https://github.com/bitflags/bitflags/releases) ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] bitflags = "1.3" ``` and this to your source code: ```rust use bitflags::bitflags; ``` ## Rust Version Support The minimum supported Rust version is 1.46 due to use of associated constants and const functions. ## Files: rust/vendor/block-buffer/README.md # [RustCrypto]: Block Buffer [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Buffer type for block processing of data with minimized amount of unreachable panics. ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/block-buffer.svg [crate-link]: https://crates.io/crates/block-buffer [docs-image]: https://docs.rs/block-buffer/badge.svg [docs-link]: https://docs.rs/block-buffer/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260052-utils [build-image]: https://github.com/RustCrypto/utils/workflows/block-buffer/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/utils/actions/workflows/block-buffer.yml [//]: # (general links) [RustCrypto]: https://github.com/rustcrypto ## Files: rust/vendor/bstr/COPYING This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. ## Files: rust/vendor/bstr/README.md bstr ==== This crate provides extension traits for `&[u8]` and `Vec` that enable their use as byte strings, where byte strings are _conventionally_ UTF-8. This differs from the standard library's `String` and `str` types in that they are not required to be valid UTF-8, but may be fully or partially valid UTF-8. [![Build status](https://github.com/BurntSushi/bstr/workflows/ci/badge.svg)](https://github.com/BurntSushi/bstr/actions) [![crates.io](https://img.shields.io/crates/v/bstr.svg)](https://crates.io/crates/bstr) ### Documentation https://docs.rs/bstr ### When should I use byte strings? See this part of the documentation for more details: . The short story is that byte strings are useful when it is inconvenient or incorrect to require valid UTF-8. ### Usage `cargo add bstr` ### Examples The following two examples exhibit both the API features of byte strings and the I/O convenience functions provided for reading line-by-line quickly. This first example simply shows how to efficiently iterate over lines in stdin, and print out lines containing a particular substring: ```rust use std::{error::Error, io::{self, Write}}; use bstr::{ByteSlice, io::BufReadExt}; fn main() -> Result<(), Box> { let stdin = io::stdin(); let mut stdout = io::BufWriter::new(io::stdout()); stdin.lock().for_byte_line_with_terminator(|line| { if line.contains_str("Dimension") { stdout.write_all(line)?; } Ok(true) })?; Ok(()) } ``` This example shows how to count all of the words (Unicode-aware) in stdin, line-by-line: ```rust use std::{error::Error, io}; use bstr::{ByteSlice, io::BufReadExt}; fn main() -> Result<(), Box> { let stdin = io::stdin(); let mut words = 0; stdin.lock().for_byte_line_with_terminator(|line| { words += line.words().count(); Ok(true) })?; println!("{}", words); Ok(()) } ``` This example shows how to convert a stream on stdin to uppercase without performing UTF-8 validation _and_ amortizing allocation. On standard ASCII text, this is quite a bit faster than what you can (easily) do with standard library APIs. (N.B. Any invalid UTF-8 bytes are passed through unchanged.) ```rust use std::{error::Error, io::{self, Write}}; use bstr::{ByteSlice, io::BufReadExt}; fn main() -> Result<(), Box> { let stdin = io::stdin(); let mut stdout = io::BufWriter::new(io::stdout()); let mut upper = vec![]; stdin.lock().for_byte_line_with_terminator(|line| { upper.clear(); line.to_uppercase_into(&mut upper); stdout.write_all(&upper)?; Ok(true) })?; Ok(()) } ``` This example shows how to extract the first 10 visual characters (as grapheme clusters) from each line, where invalid UTF-8 sequences are generally treated as a single character and are passed through correctly: ```rust use std::{error::Error, io::{self, Write}}; use bstr::{ByteSlice, io::BufReadExt}; fn main() -> Result<(), Box> { let stdin = io::stdin(); let mut stdout = io::BufWriter::new(io::stdout()); stdin.lock().for_byte_line_with_terminator(|line| { let end = line .grapheme_indices() .map(|(_, end, _)| end) .take(10) .last() .unwrap_or(line.len()); stdout.write_all(line[..end].trim_end())?; stdout.write_all(b"\n")?; Ok(true) })?; Ok(()) } ``` ### Cargo features This crates comes with a few features that control standard library, serde and Unicode support. * `std` - **Enabled** by default. This provides APIs that require the standard library, such as `Vec` and `PathBuf`. Enabling this feature also enables the `alloc` feature. * `alloc` - **Enabled** by default. This provides APIs that require allocations via the `alloc` crate, such as `Vec`. * `unicode` - **Enabled** by default. This provides APIs that require sizable Unicode data compiled into the binary. This includes, but is not limited to, grapheme/word/sentence segmenters. When this is disabled, basic support such as UTF-8 decoding is still included. Note that currently, enabling this feature also requires enabling the `std` feature. It is expected that this limitation will be lifted at some point. * `serde` - Enables implementations of serde traits for `BStr`, and also `BString` when `alloc` is enabled. ### Minimum Rust version policy This crate's minimum supported `rustc` version (MSRV) is `1.73`. In general, this crate will be conservative with respect to the minimum supported version of Rust. MSRV may be bumped in minor version releases. ### Future work Since it is plausible that some of the types in this crate might end up in your public API (e.g., `BStr` and `BString`), we will commit to being very conservative with respect to new major version releases. It's difficult to say precisely how conservative, but unless there is a major issue with the `1.0` release, I wouldn't expect a `2.0` release to come out any sooner than some period of years. A large part of the API surface area was taken from the standard library, so from an API design perspective, a good portion of this crate should be on solid ground. The main differences from the standard library are in how the various substring search routines work. The standard library provides generic infrastructure for supporting different types of searches with a single method, where as this library prefers to define new methods for each type of search and drop the generic infrastructure. Some _probable_ future considerations for APIs include, but are not limited to: * Unicode normalization. * More sophisticated support for dealing with Unicode case, perhaps by combining the use cases supported by [`caseless`](https://docs.rs/caseless) and [`unicase`](https://docs.rs/unicase). Here are some examples that are _probably_ out of scope for this crate: * Regular expressions. * Unicode collation. The exact scope isn't quite clear, but I expect we can iterate on it. In general, as stated below, this crate brings lots of related APIs together into a single crate while simultaneously attempting to keep the total number of dependencies low. Indeed, every dependency of `bstr`, except for `memchr`, is optional. ### High level motivation Strictly speaking, the `bstr` crate provides very little that can't already be achieved with the standard library `Vec`/`&[u8]` APIs and the ecosystem of library crates. For example: * The standard library's [`Utf8Error`](https://doc.rust-lang.org/std/str/struct.Utf8Error.html) can be used for incremental lossy decoding of `&[u8]`. * The [`unicode-segmentation`](https://unicode-rs.github.io/unicode-segmentation/unicode_segmentation/index.html) crate can be used for iterating over graphemes (or words), but is only implemented for `&str` types. One could use `Utf8Error` above to implement grapheme iteration with the same semantics as what `bstr` provides (automatic Unicode replacement codepoint substitution). * The [`twoway`](https://docs.rs/twoway) crate can be used for fast substring searching on `&[u8]`. So why create `bstr`? Part of the point of the `bstr` crate is to provide a uniform API of coupled components instead of relying on users to piece together loosely coupled components from the crate ecosystem. For example, if you wanted to perform a search and replace in a `Vec`, then writing the code to do that with the `twoway` crate is not that difficult, but it's still additional glue code you have to write. This work adds up depending on what you're doing. Consider, for example, trimming and splitting, along with their different variants. In other words, `bstr` is partially a way of pushing back against the micro-crate ecosystem that appears to be evolving. Namely, it is a goal of `bstr` to keep its dependency list lightweight. For example, `serde` is an optional dependency because there is no feasible alternative. In service of this philosophy, currently, the only required dependency of `bstr` is `memchr`. ### License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. The data in `src/unicode/data/` is licensed under the Unicode License Agreement ([LICENSE-UNICODE](https://www.unicode.org/copyright.html#License)), although this data is only used in tests. ## Files: rust/vendor/byteorder/README.md byteorder ========= This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order. [![Build status](https://github.com/BurntSushi/byteorder/workflows/ci/badge.svg)](https://github.com/BurntSushi/byteorder/actions) [![](https://meritbadge.herokuapp.com/byteorder)](https://crates.io/crates/byteorder) Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/). ### Documentation https://docs.rs/byteorder ### Installation This crate works with Cargo and is on [crates.io](https://crates.io/crates/byteorder). Add it to your `Cargo.toml` like so: ```toml [dependencies] byteorder = "1" ``` If you want to augment existing `Read` and `Write` traits, then import the extension methods like so: ```rust use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian}; ``` For example: ```rust use std::io::Cursor; use byteorder::{BigEndian, ReadBytesExt}; let mut rdr = Cursor::new(vec![2, 5, 3, 0]); // Note that we use type parameters to indicate which kind of byte order // we want! assert_eq!(517, rdr.read_u16::().unwrap()); assert_eq!(768, rdr.read_u16::().unwrap()); ``` ### `no_std` crates This crate has a feature, `std`, that is enabled by default. To use this crate in a `no_std` context, add the following to your `Cargo.toml`: ```toml [dependencies] byteorder = { version = "1", default-features = false } ``` ### Alternatives Note that as of Rust 1.32, the standard numeric types provide built-in methods like `to_le_bytes` and `from_le_bytes`, which support some of the same use cases. ## Files: rust/vendor/cc/README.md # cc-rs A library for [Cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html) to compile a set of C/C++/assembly/CUDA files into a static archive for Cargo to link into the crate being built. This crate does not compile code itself; it calls out to the default compiler for the platform. This crate will automatically detect situations such as cross compilation and various environment variables and will build code appropriately. Refer to the [documentation](https://docs.rs/cc) for detailed usage instructions. ## License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in cc-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/cdylib-link-lines/README.md # link-line helper to build correct cdylibs [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) ## Supported targets - Linux and Android - macOS and iOS - Windows (gnu) ## Usage ### build.rs Add the crate to your [build-dependencies](https://doc.rust-lang.org/cargo/reference/manifest.html#dependency-sections), in your `build.rs`, call `metabuild()`. ``` toml [build-dependencies] cdylib-link-lines = "0.1" ``` ``` rust fn main() { cdylib_link_lines::metabuild(); } ``` ### metabuild If you are using the `metabuild` [unstable feature](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#metabuild) ``` toml cargo-features = ["metabuild"] [package] name = "mypackage" ... metabuild = ["cdylib-link-lines"] [build-dependencies] cdylib-link-lines = "0.1" ``` ## Credits Helper spun off [crav1e](https://github.com/lu-zero/crav1e), contains code written by Luca Barbato and Derek Buitenhuis. Synchronized with the [cargo-c](https://github.com/lu-zero/cargo-c) 0.9 logic thanks to Ivan Enderlin. ## Files: rust/vendor/cfg-if/README.md # cfg-if [Documentation](https://docs.rs/cfg-if) A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted. ```toml [dependencies] cfg-if = "0.1" ``` ## Example ```rust cfg_if::cfg_if! { if #[cfg(unix)] { fn foo() { /* unix specific functionality */ } } else if #[cfg(target_pointer_width = "32")] { fn foo() { /* non-unix, 32-bit functionality */ } } else { fn foo() { /* fallback implementation */ } } } fn main() { foo(); } ``` # License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/cipher/README.md # RustCrypto: Cipher Traits [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Traits which define the functionality of [block ciphers] and [stream ciphers]. See [RustCrypto/block-ciphers] and [RustCrypto/stream-ciphers] for algorithm implementations which use these traits. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/cipher.svg [crate-link]: https://crates.io/crates/cipher [docs-image]: https://docs.rs/cipher/badge.svg [docs-link]: https://docs.rs/cipher/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260050-traits [build-image]: https://github.com/RustCrypto/traits/workflows/cipher/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/traits/actions?query=workflow:cipher [//]: # (general links) [block ciphers]: https://en.wikipedia.org/wiki/Block_cipher [stream ciphers]: https://en.wikipedia.org/wiki/Stream_cipher [RustCrypto/block-ciphers]: https://github.com/RustCrypto/block-ciphers [RustCrypto/stream-ciphers]: https://github.com/RustCrypto/stream-ciphers ## Files: rust/vendor/clap/README.md # clap > **Command Line Argument Parser for Rust** [![Crates.io](https://img.shields.io/crates/v/clap?style=flat-square)](https://crates.io/crates/clap) [![Crates.io](https://img.shields.io/crates/d/clap?style=flat-square)](https://crates.io/crates/clap) [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE-MIT) [![Build Status](https://img.shields.io/github/actions/workflow/status/clap-rs/clap/ci.yml?branch=master&style=flat-square)](https://github.com/clap-rs/clap/actions/workflows/ci.yml?query=branch%3Amaster) [![Coverage Status](https://img.shields.io/coveralls/github/clap-rs/clap/master?style=flat-square)](https://coveralls.io/github/clap-rs/clap?branch=master) [![Contributors](https://img.shields.io/github/contributors/clap-rs/clap?style=flat-square)](https://github.com/clap-rs/clap/graphs/contributors) Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT). ## About Create your command-line parser, with all of the bells and whistles, declaratively or procedurally. For more details, see: - [docs.rs](https://docs.rs/clap/latest/clap/) - [examples](examples/) ## Sponsors ### Gold [![](https://opencollective.com/clap/tiers/gold.svg?avatarHeight=36&width=600)](https://opencollective.com/clap) ### Silver [![](https://opencollective.com/clap/tiers/silver.svg?avatarHeight=36&width=600)](https://opencollective.com/clap) ### Bronze [![](https://opencollective.com/clap/tiers/bronze.svg?avatarHeight=36&width=600)](https://opencollective.com/clap) ### Backer [![](https://opencollective.com/clap/tiers/backer.svg?avatarHeight=36&width=600)](https://opencollective.com/clap) ## Files: rust/vendor/clap_builder/README.md # `clap_builder` Builder implementation for clap. [docs.rs](https://docs.rs/clap) - [Derive Tutorial](https://docs.rs/clap/latest/clap/_derive/_tutorial/index.html) - [Derive Reference](https://docs.rs/clap/latest/clap/_derive/index.html) ## License Licensed under either of - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or ) - MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. See [CONTRIBUTING](CONTRIBUTING.md) for more details. ## Files: rust/vendor/clap_derive/README.md # `clap_derive` Macro implementation for clap's derives. [docs.rs](https://docs.rs/clap) - [Derive Tutorial](https://docs.rs/clap/latest/clap/_derive/_tutorial/index.html) - [Derive Reference](https://docs.rs/clap/latest/clap/_derive/index.html) ## License Licensed under either of - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or ) - MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. See [CONTRIBUTING](CONTRIBUTING.md) for more details. ## Files: rust/vendor/clap_lex/README.md # clap_lex > **Minimal, flexible command line parser** [![Crates.io](https://img.shields.io/crates/v/clap_lex?style=flat-square)](https://crates.io/crates/clap_lex) [![Crates.io](https://img.shields.io/crates/d/clap_lex?style=flat-square)](https://crates.io/crates/clap_lex) [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_lex-v0.7.4/LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_lex-v0.7.4/LICENSE-MIT) Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT). 1. [About](#about) 2. [API Reference](https://docs.rs/clap_lex) 3. [Questions & Discussions](https://github.com/clap-rs/clap/discussions) 4. [CONTRIBUTING](https://github.com/clap-rs/clap/blob/clap_lex-v0.7.4/clap_lex/CONTRIBUTING.md) 5. [Sponsors](https://github.com/clap-rs/clap/blob/clap_lex-v0.7.4/README.md#sponsors) ## About ## Files: rust/vendor/cpufeatures/README.md # [RustCrypto]: CPU Feature Detection [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] [![Build Status][build-image]][build-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] Lightweight and efficient runtime CPU feature detection for `aarch64`, `loongarch64`, and `x86`/`x86_64` targets. Supports `no_std` as well as mobile targets including iOS and Android, providing an alternative to the `std`-dependent `is_x86_feature_detected!` macro. [Documentation][docs-link] # Supported target architectures *NOTE: target features with an asterisk are unstable (nightly-only) and subject to change to match upstream name changes in the Rust standard library. ## `aarch64` Linux, iOS, and macOS/ARM only (ARM64 does not support OS-independent feature detection) Target features: - `aes`* - `sha2`* - `sha3`* ## `loongarch64` Linux only (LoongArch64 does not support OS-independent feature detection) Target features: - `lam`* - `ual`* - `fpu`* - `lsx`* - `lasx`* - `crc32`* - `complex`* - `crypto`* - `lvz`* - `lbt.x86`* - `lbt.arm`* - `lbt.mips`* - `ptw`* ## `x86`/`x86_64` OS independent and `no_std`-friendly Target features: - `adx` - `aes` - `avx` - `avx2` - `avx512bw`* - `avx512cd`* - `avx512dq`* - `avx512er`* - `avx512f`* - `avx512ifma`* - `avx512pf`* - `avx512vl`* - `avx512vbmi`* - `avx512vbmi2`* - `bmi1` - `bmi2` - `fma`, - `mmx` - `pclmulqdq` - `popcnt` - `rdrand` - `rdseed` - `sgx` - `sha` - `sse` - `sse2` - `sse3` - `sse4.1` - `sse4.2` - `ssse3` If you would like detection support for a target feature which is not on this list, please [open a GitHub issue]. ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/cpufeatures.svg?logo=rust [crate-link]: https://crates.io/crates/cpufeatures [docs-image]: https://docs.rs/cpufeatures/badge.svg [docs-link]: https://docs.rs/cpufeatures/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.40+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260052-utils [build-image]: https://github.com/RustCrypto/utils/actions/workflows/cpufeatures.yml/badge.svg [build-link]: https://github.com/RustCrypto/utils/actions/workflows/cpufeatures.yml [//]: # (general links) [RustCrypto]: https://github.com/rustcrypto [RustCrypto/utils#378]: https://github.com/RustCrypto/utils/issues/378 [open a GitHub issue]: https://github.com/RustCrypto/utils/issues/new?title=cpufeatures:%20requesting%20support%20for%20CHANGEME%20target%20feature ## Files: rust/vendor/crc/README.md # crc [![Build Status](https://travis-ci.org/mrhooray/crc-rs.svg?branch=master)](https://travis-ci.org/mrhooray/crc-rs) > Rust implementation of CRC(16, 32, 64) with support of various standards * [Crate](https://crates.io/crates/crc) * [Documentation](https://docs.rs/crc/) * [Usage](#usage) * [Benchmark](#benchmark) * [License](#license) ## Usage Add `crc` to `Cargo.toml` ```toml [dependencies] crc = "^1.0.0" ``` or ```toml [dependencies.crc] git = "https://github.com/mrhooray/crc-rs" ``` Add this to crate root ```rust extern crate crc; ``` ### Compute CRC16 ```rust use crc::{crc16, Hasher16}; assert_eq!(crc16::checksum_x25(b"123456789"), 0x906e); assert_eq!(crc16::checksum_usb(b"123456789"), 0xb4c8); // use provided or custom polynomial let mut digest = crc16::Digest::new(crc16::X25); digest.write(b"123456789"); assert_eq!(digest.sum16(), 0x906e); // with initial let mut digest = crc16::Digest::new_with_initial(crc16::X25, 0u16); digest.write(b"123456789"); assert_eq!(digest.sum16(), 0x906e); ``` ### Compute CRC32 ```rust use crc::{crc32, Hasher32}; // CRC-32-IEEE being the most commonly used one assert_eq!(crc32::checksum_ieee(b"123456789"), 0xcbf43926); assert_eq!(crc32::checksum_castagnoli(b"123456789"), 0xe3069283); assert_eq!(crc32::checksum_koopman(b"123456789"), 0x2d3dd0ae); // use provided or custom polynomial let mut digest = crc32::Digest::new(crc32::IEEE); digest.write(b"123456789"); assert_eq!(digest.sum32(), 0xcbf43926); // with initial let mut digest = crc32::Digest::new_with_initial(crc32::IEEE, 0u32); digest.write(b"123456789"); assert_eq!(digest.sum32(), 0xcbf43926); ``` ### Compute CRC64 ```rust use crc::{crc64, Hasher64}; assert_eq!(crc64::checksum_ecma(b"123456789"), 0x995dc9bbdf1939fa); assert_eq!(crc64::checksum_iso(b"123456789"), 0xb90956c775a41001); // use provided or custom polynomial let mut digest = crc64::Digest::new(crc64::ECMA); digest.write(b"123456789"); assert_eq!(digest.sum64(), 0x995dc9bbdf1939fa); // with initial let mut digest = crc64::Digest::new_with_initial(crc64::ECMA, 0u64); digest.write(b"123456789"); assert_eq!(digest.sum64(), 0x995dc9bbdf1939fa); ``` ## Benchmark > Bencher is currently not available in Rust stable releases. `cargo bench` with 2.3 GHz Intel Core i7 results ~430MB/s throughput. [Comparison](http://create.stephan-brumme.com/crc32/) ``` cargo bench Running target/release/bench-5c82e94dab3e9c79 running 4 tests test bench_crc32_make_table ... bench: 439 ns/iter (+/- 82) test bench_crc32_update_megabytes ... bench: 2327803 ns/iter (+/- 138845) test bench_crc64_make_table ... bench: 1200 ns/iter (+/- 223) test bench_crc64_update_megabytes ... bench: 2322472 ns/iter (+/- 92870) test result: ok. 0 passed; 0 failed; 0 ignored; 4 measured ``` ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/crc32fast/README.md # crc32fast [![Build Status][build-img]][build] [![Crates.io][crates-img]][crates] [![Documentation][docs-img]][docs] [build-img]: https://github.com/srijs/rust-crc32fast/actions/workflows/ci.yml/badge.svg [build]: https://github.com/srijs/rust-crc32fast/actions/workflows/ci.yml [crates-img]: https://img.shields.io/crates/v/crc32fast.svg [crates]: https://crates.io/crates/crc32fast [docs-img]: https://docs.rs/crc32fast/badge.svg [docs]: https://docs.rs/crc32fast _Fast, SIMD-accelerated CRC32 (IEEE) checksum computation_ ## Usage ### Simple usage For simple use-cases, you can call the `hash` convenience function to directly compute the CRC32 checksum for a given byte slice: ```rust let checksum = crc32fast::hash(b"foo bar baz"); ``` ### Advanced usage For use-cases that require more flexibility or performance, for example when processing large amounts of data, you can create and manipulate a `Hasher`: ```rust use crc32fast::Hasher; let mut hasher = Hasher::new(); hasher.update(b"foo bar baz"); let checksum = hasher.finalize(); ``` ## Performance This crate contains multiple CRC32 implementations: - A fast baseline implementation which processes up to 16 bytes per iteration - An optimized implementation for modern `x86` using `sse` and `pclmulqdq` instructions - An optimized implementation for `aarch64` using `crc32` instructions Calling the `Hasher::new` constructor at runtime will perform a feature detection to select the most optimal implementation for the current CPU feature set. | crate | version | variant | ns/iter | MB/s | | ----------------------------------- | ------- | --------- | ------- | ---- | | [crc](https://crates.io/crates/crc) | 1.8.1 | n/a | 4,926 | 207 | | crc32fast (this crate) | 1.0.0 | baseline | 683 | 1499 | | crc32fast (this crate) | 1.0.0 | pclmulqdq | 140 | 7314 | ## Memory Safety Due to the use of SIMD intrinsics for the optimized implementations, this crate contains some amount of `unsafe` code. In order to ensure memory safety, the relevant code has been fuzz tested using [afl.rs](https://github.com/rust-fuzz/afl.rs) with millions of iterations in both `debug` and `release` build settings. You can inspect the test setup in the `fuzz` sub-directory, which also has instructions on how to run the tests yourself. On top of that, every commit is tested using an address sanitizer in CI to catch any out of bounds memory accesses. Even though neither fuzzing nor sanitization has revealed any safety bugs yet, please don't hesitate to file an issue if you run into any crashes or other unexpected behaviour. ## Available feature flags ### `std` (default: enabled) This library supports being built without the Rust `std` library, which is useful for low-level use-cases such as embedded where no operating system is available. To build the crate in a `no_std` context, disable the default `std` feature. Note: Because runtime CPU feature detection requires OS support, the specialized SIMD implementations will be unavailable when the `std` feature is disabled. ### `nightly` (default: disabled) This feature flag enables unstable features that are only available on the `nightly` channel. Keep in mind that when enabling this feature flag, you might experience breaking changes when updating compiler versions. Currently, enabling this feature flag will make the optimized `aarch64` implementation available. ## License This project is licensed under either of - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/crypto-common/README.md # RustCrypto: Common Cryptographic Traits [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Common traits used by cryptographic algorithms. Users should generally use higher-level trait crates instead of this one. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/crypto-common.svg [crate-link]: https://crates.io/crates/crypto-common [docs-image]: https://docs.rs/crypto-common/badge.svg [docs-link]: https://docs.rs/crypto-common/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/traits/workflows/crypto-common/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/traits/actions?query=workflow%3Acrypto-common ## Files: rust/vendor/ctr/README.md # RustCrypto: Counter Mode (CTR) [![Crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] [![HAZMAT][hazmat-image]][hazmat-link] Generic implementations of the [Counter Mode (CTR)][1] of operation for block ciphers, which enables adapting block ciphers into stream ciphers. [Documentation][docs-link] diagram ## ⚠️ Security Warning: [Hazmat!][hazmat-link] This crate does not ensure ciphertexts are authentic (i.e. by using a MAC to verify ciphertext integrity), which can lead to serious vulnerabilities if used incorrectly! No security audits of this crate have ever been performed, and it has not been thoroughly assessed to ensure its operation is constant-time on common CPU architectures. **USE AT YOUR OWN RISK!** ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/ctr.svg [crate-link]: https://crates.io/crates/ctr [docs-image]: https://docs.rs/ctr/badge.svg [docs-link]: https://docs.rs/ctr/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260049-stream-ciphers [build-image]: https://github.com/RustCrypto/stream-ciphers/workflows/ctr/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/stream-ciphers/actions?query=workflow%3Actr [hazmat-image]: https://img.shields.io/badge/crypto-hazmat%E2%9A%A0-red.svg [hazmat-link]: https://github.com/RustCrypto/meta/blob/master/HAZMAT.md [//]: # (footnotes) [1]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#CTR ## Files: rust/vendor/der-parser/README.md [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![docs.rs](https://docs.rs/der-parser/badge.svg)](https://docs.rs/der-parser) [![crates.io](https://img.shields.io/crates/v/der-parser.svg)](https://crates.io/crates/der-parser) [![Download numbers](https://img.shields.io/crates/d/der-parser.svg)](https://crates.io/crates/der-parser) [![dependency status](https://deps.rs/crate/der-parser/9.0.0/status.svg)](https://deps.rs/crate/der-parser/9.0.0) [![Github CI](https://github.com/rusticata/der-parser/workflows/Continuous%20integration/badge.svg)](https://github.com/rusticata/der-parser/actions) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.63.0+-lightgray.svg)](#rust-version-requirements) # BER/DER Parser A parser for Basic Encoding Rules (BER [[X.690]]) and Distinguished Encoding Rules(DER [[X.690]]), implemented with the [nom](https://github.com/Geal/nom) parser combinator framework. It is written in pure Rust, fast, and makes extensive use of zero-copy. A lot of care is taken to ensure security and safety of this crate, including design (recursion limit, defensive programming), tests, and fuzzing. It also aims to be panic-free. Historically, this parser was intended for DER only, and BER support was added later. This may still reflect on some naming schemes, but has no other consequence: the `BerObject` and `DerObject` used in this crate are type aliases, so all functions are compatible. DER parsing functions have additional constraints verification, however. Serialization has also been added (see [Serialization](#serialization) ) The code is available on [Github](https://github.com/rusticata/der-parser) and is part of the [Rusticata](https://github.com/rusticata) project. # BER/DER parsers BER stands for Basic Encoding Rules, and is defined in [X.690]. It defines a set of rules to encode and decode ASN.1 objects in binary. [X.690] also defines Distinguished Encoding Rules (DER), which is BER with added rules to ensure canonical and unequivocal binary representation of objects. The choice of which one to use is usually guided by the speficication of the data format based on BER or DER: for example, X.509 uses DER as encoding representation. See the related modules for object definitions, functions, and example: - [`ber`]: Basic Encoding Rules - [`der`]: Distinguished Encoding Rules ## Examples Parse two BER integers (see [BER/DER Integers](#berder-integers)): ```rust use der_parser::ber::parse_ber_integer; let bytes = [ 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; let (rem, obj1) = parse_ber_integer(&bytes).expect("parsing failed"); let (rem, obj2) = parse_ber_integer(&rem).expect("parsing failed"); ``` Parse a DER sequence of integers: ```rust use der_parser::der::{parse_der_integer, parse_der_sequence_of}; let bytes = [ 0x30, 0x0a, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; let (rem, seq) = parse_der_sequence_of(parse_der_integer)(&bytes) .expect("parsing failed"); ``` Note: all parsing functions return the remaining (unparsed) bytes and the parsed object, or an error. # DER parser design Parsing functions are inspired from `nom`, and follow the same interface. The most common return type is [`BerResult`](https://docs.rs/der-parser/latest/der_parser/error/type.BerResult.html), that stores the remaining bytes and parsed [`BerObject`](https://docs.rs/der-parser/latest/der_parser/ber/struct.BerObject.html), or an error. Reading the nom documentation may help understanding how to write parsers and use the output. There are two different approaches for parsing DER objects: reading the objects recursively as long as the tags are known, or specifying a description of the expected objects (generally from the [ASN.1][X.680] description). The first parsing method can be done using the [`parse_ber`](https://docs.rs/der-parser/latest/der_parser/ber/fn.parse_ber.html) and [`parse_der`](https://docs.rs/der-parser/latest/der_parser/der/fn.parse_der.html) methods. It is useful when decoding an arbitrary DER object. However, it cannot fully parse all objects, especially those containing IMPLICIT, OPTIONAL, or DEFINED BY items. ```rust use der_parser::parse_der; let bytes = [ 0x30, 0x0a, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; let parsed = parse_der(&bytes); ``` The second (and preferred) parsing method is to specify the expected objects recursively. The following functions can be used: - [`parse_ber_sequence_defined`](https://docs.rs/der-parser/latest/der_parser/ber/fn.parse_ber_sequence_defined.html) and similar functions for sequences and sets variants - [`parse_ber_tagged_explicit`](https://docs.rs/der-parser/latest/der_parser/ber/fn.parse_ber_tagged_explicit.html) for tagged explicit - [`parse_ber_tagged_implicit`](https://docs.rs/der-parser/latest/der_parser/ber/fn.parse_ber_tagged_implicit.html) for tagged implicit - [`parse_ber_container`](https://docs.rs/der-parser/latest/der_parser/ber/fn.parse_ber_container.html) for generic parsing, etc. - DER objects use the `_der_` variants For example, to read a BER sequence containing two integers: ```rust use der_parser::ber::*; use der_parser::error::BerResult; fn localparse_seq(i:&[u8]) -> BerResult { parse_ber_sequence_defined(|data| { let (rem, a) = parse_ber_integer(data)?; let (rem, b) = parse_ber_integer(rem)?; Ok((rem, vec![a, b])) })(i) } let bytes = [ 0x30, 0x0a, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x00, ]; let (_, parsed) = localparse_seq(&bytes).expect("parsing failed"); assert_eq!(parsed[0].as_u64(), Ok(65537)); assert_eq!(parsed[1].as_u64(), Ok(65536)); ``` All functions return a [`BerResult`](https://docs.rs/der-parser/latest/der_parser/error/type.BerResult.html) object: the parsed [`BerObject`](https://docs.rs/der-parser/latest/der_parser/ber/struct.BerObject.html), an `Incomplete` value, or an error. Note that this type is also a `Result`, so usual functions (`map`, `unwrap` etc.) are available. # Notes ## BER/DER Integers DER integers can be of any size, so it is not possible to store them as simple integers (they are stored as raw bytes). Note that, by default, BER/DER integers are signed. Functions are provided to request reading unsigned values, but they will fail if the integer value is negative. To get the integer value for all possible integer sign and size, use [`BerObject::as_bigint`](https://docs.rs/der-parser/latest/der_parser/ber/struct.BerObject.html#method.as_bigint)) (requires the `bigint` feature). To get a simple value expected to be in a known range, use methods like [`BerObject::as_i32`](ber/struct.BerObject.html#method.as_i32)) and [`BerObject::as_i64`](ber/struct.BerObject.html#method.as_i64) (or the unsigned versions [`BerObject::as_u32`](ber/struct.BerObject.html#method.as_u32) and [`BerObject::as_u64`](ber/struct.BerObject.html#method.as_u64) ), which will return the value, or an error if the integer is too large (or is negative). ```rust use der_parser::ber::*; let data = &[0x02, 0x03, 0x01, 0x00, 0x01]; let (_, object) = parse_ber_integer(data).expect("parsing failed"); assert_eq!(object.as_u64(), Ok(65537)); #[cfg(feature = "bigint")] assert_eq!(object.as_bigint(), Ok(65537.into())) ``` Access to the raw value is possible using the `as_slice` method. ## Parsers, combinators, macros Some parsing tools (for ex for tagged objects) are available in different forms: - parsers: (regular) functions that takes input and create an object - combinators: functions that takes parsers (or combinators) as input, and return a function (usually, the parser). They are used (combined) as building blocks to create more complex parsers. - macros: these are generally previous (historic) versions of parsers, kept for compatibility. They can sometime reduce the amount of code to write, but are hard to debug. Parsers should be preferred when possible. ## Misc Notes - The DER constraints are verified if using `parse_der`. - `BerObject` and `DerObject` are the same objects (type alias). The only difference is the verification of constraints *during parsing*. ## Rust version requirements The 7.0 series of `der-parser` requires **Rustc version 1.53 or greater**, based on `asn1-rs` and `nom` 7 dependencies. # Serialization Support for encoding BER/DER objects is currently being tested and can be used by activating the `serialize` feature. Note that current status is **experimental**. See the `ber_encode_*` functions in the [`ber`](https://docs.rs/der-parser/latest/der_parser/ber/index.html) module, and [`BerObject::to_vec`](https://docs.rs/der-parser/latest/der_parser/ber/struct.BerObject.html#method.to_vec) # References - [[X.680]] Abstract Syntax Notation One (ASN.1): Specification of basic notation. - [[X.690]] ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER). [X.680]: http://www.itu.int/rec/T-REC-X.680/en "Abstract Syntax Notation One (ASN.1): Specification of basic notation." [X.690]: https://www.itu.int/rec/T-REC-X.690/en "ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)." ## Changes See `CHANGELOG.md`, and `UPGRADING.md` for instructions for upgrading major versions. ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/digest/README.md # RustCrypto: Digest Algorithm Traits [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Traits which describe functionality of [cryptographic hash functions][0], a.k.a. digest algorithms. See [RustCrypto/hashes][1] for implementations which use this trait. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## Usage Let us demonstrate how to use crates in this repository using Sha256 as an example. First add the `sha2` crate to your `Cargo.toml`: ```toml [dependencies] sha2 = "0.10" ``` `sha2` and other crates re-export `digest` crate and `Digest` trait for convenience, so you don't have to add `digest` crate as an explicit dependency. Now you can write the following code: ```rust use sha2::{Sha256, Digest}; let mut hasher = Sha256::new(); let data = b"Hello world!"; hasher.update(data); // `input` can be called repeatedly and is generic over `AsRef<[u8]>` hasher.update("String data"); // Note that calling `finalize()` consumes hasher let hash = hasher.finalize(); println!("Result: {:x}", hash); ``` In this example `hash` has type [`GenericArray`][2], which is a generic alternative to `[u8; 64]`. Alternatively you can use chained approach, which is equivalent to the previous example: ```rust let hash = Sha256::new() .chain_update(b"Hello world!") .chain_update("String data") .finalize(); println!("Result: {:x}", hash); ``` If the whole message is available you also can use convenience `digest` method: ```rust let hash = Sha256::digest(b"my message"); println!("Result: {:x}", hash); ``` ### Hashing `Read`-able objects If you want to hash data from [`Read`][3] trait (e.g. from file) you can rely on implementation of [`Write`][4] trait (requires enabled-by-default `std` feature): ```rust use sha2::{Sha256, Digest}; use std::{fs, io}; let mut file = fs::File::open(&path)?; let mut hasher = Sha256::new(); let n = io::copy(&mut file, &mut hasher)?; let hash = hasher.finalize(); println!("Path: {}", path); println!("Bytes processed: {}", n); println!("Hash value: {:x}", hash); ``` ### Generic code You can write generic code over `Digest` (or other traits from `digest` crate) trait which will work over different hash functions: ```rust use digest::Digest; // Toy example, do not use it in practice! // Instead use crates from: https://github.com/RustCrypto/password-hashing fn hash_password(password: &str, salt: &str, output: &mut [u8]) { let mut hasher = D::new(); hasher.update(password.as_bytes()); hasher.update(b"$"); hasher.update(salt.as_bytes()); output.copy_from_slice(hasher.finalize().as_slice()) } let mut buf1 = [0u8; 32]; let mut buf2 = [0u8; 64]; hash_password::("my_password", "abcd", &mut buf1); hash_password::("my_password", "abcd", &mut buf2); ``` If you want to use hash functions with trait objects, use `digest::DynDigest` trait. ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/digest.svg [crate-link]: https://crates.io/crates/digest [docs-image]: https://docs.rs/digest/badge.svg [docs-link]: https://docs.rs/digest/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/traits/workflows/digest/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/traits/actions?query=workflow%3Adigest [//]: # (general links) [0]: https://en.wikipedia.org/wiki/Cryptographic_hash_function [1]: https://github.com/RustCrypto/hashes [2]: https://docs.rs/generic-array [3]: https://doc.rust-lang.org/std/io/trait.Read.html [4]: https://doc.rust-lang.org/std/io/trait.Write.html [5]: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code [6]: https://github.com/RustCrypto/MACs ## Files: rust/vendor/displaydoc/README.md derive(Display) /// `From` =============== [![Latest Version](https://img.shields.io/crates/v/displaydoc.svg)](https://crates.io/crates/displaydoc) [![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/displaydoc) This library provides a convenient derive macro for the standard library's [`core::fmt::Display`] trait. [`core::fmt::Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html ```toml [dependencies] displaydoc = "0.2" ``` *Compiler support: requires rustc 1.56+*
### Example *Demonstration alongside the [`Error`][std::error::Error] derive macro from [`thiserror`](https://docs.rs/thiserror/1.0.25/thiserror/index.html), to propagate source locations from [`io::Error`][std::io::Error] with the `#[source]` attribute:* ```rust use std::io; use displaydoc::Display; use thiserror::Error; #[derive(Display, Error, Debug)] pub enum DataStoreError { /// data store disconnected Disconnect(#[source] io::Error), /// the data for key `{0}` is not available Redaction(String), /// invalid header (expected {expected:?}, found {found:?}) InvalidHeader { expected: String, found: String, }, /// unknown data store error Unknown, } let error = DataStoreError::Redaction("CLASSIFIED CONTENT".to_string()); assert!("the data for key `CLASSIFIED CONTENT` is not available" == &format!("{}", error)); ``` *Note that although [`io::Error`][std::io::Error] implements `Display`, we do not add it to the generated message for `DataStoreError::Disconnect`, since it is already made available via `#[source]`. See further context on avoiding duplication in error reports at the rust blog [here](https://github.com/yaahc/blog.rust-lang.org/blob/master/posts/inside-rust/2021-05-15-What-the-error-handling-project-group-is-working-towards.md#duplicate-information-issue).*
### Details - A `fmt::Display` impl is generated for your enum if you provide a docstring comment on each variant as shown above in the example. The `Display` derive macro supports a shorthand for interpolating fields from the error: - `/// {var}` ⟶ `write!("{}", self.var)` - `/// {0}` ⟶ `write!("{}", self.0)` - `/// {var:?}` ⟶ `write!("{:?}", self.var)` - `/// {0:?}` ⟶ `write!("{:?}", self.0)` - This also works with structs and [generic types][crate::Display#generic-type-parameters]: ```rust /// oh no, an error: {0} #[derive(Display)] pub struct Error(pub E); let error: Error<&str> = Error("muahaha i am an error"); assert!("oh no, an error: muahaha i am an error" == &format!("{}", error)); ``` - Two optional attributes can be added to your types next to the derive: - `#[ignore_extra_doc_attributes]` makes the macro ignore any doc comment attributes (or `///` lines) after the first. Multi-line comments using `///` are otherwise treated as an error, so use this attribute or consider switching to block doc comments (`/** */`). - `#[prefix_enum_doc_attributes]` combines the doc comment message on your enum itself with the messages for each variant, in the format “enum: variant”. When added to an enum, the doc comment on the enum becomes mandatory. When added to any other type, it has no effect. - In case you want to have an independent doc comment, the `#[displaydoc("...")` atrribute may be used on the variant or struct to override it.
### FAQ 1. **Is this crate `no_std` compatible?** * Yes! This crate implements the [`core::fmt::Display`] trait, not the [`std::fmt::Display`] trait, so it should work in `std` and `no_std` environments. Just add `default-features = false`. 2. **Does this crate work with `Path` and `PathBuf` via the `Display` trait?** * Yuuup. This crate uses @dtolnay's [autoref specialization technique](https://github.com/dtolnay/case-studies/blob/master/autoref-specialization/README.md) to add a special trait for types to get the display impl. It then specializes for `Path` and `PathBuf`, and when either of these types are found, it calls `self.display()` to get a `std::path::Display<'_>` type which can be used with the `Display` format specifier! #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/equivalent/README.md # Equivalent [![crates.io](https://img.shields.io/crates/v/equivalent.svg)](https://crates.io/crates/equivalent) [![docs](https://docs.rs/equivalent/badge.svg)](https://docs.rs/equivalent) `Equivalent` and `Comparable` are Rust traits for key comparison in maps. These may be used in the implementation of maps where the lookup type `Q` may be different than the stored key type `K`. * `Q: Equivalent` checks for equality, similar to the `HashMap` constraint `K: Borrow, Q: Eq`. * `Q: Comparable` checks the ordering, similar to the `BTreeMap` constraint `K: Borrow, Q: Ord`. These traits are not used by the maps in the standard library, but they may add more flexibility in third-party map implementations, especially in situations where a strict `K: Borrow` relationship is not available. ## License Equivalent is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details. Opening a pull request is assumed to signal agreement with these licensing terms. ## Files: rust/vendor/failure/README.md # failure - a new error management story **Notice**: `failure` is deprecated. If you liked `failure`'s API, consider using: - [Anyhow](https://github.com/dtolnay/anyhow) is a good replacement for `failure::Error`. - [thiserror](https://github.com/dtolnay/thiserror) is a good, near drop-in replacement for `#[derive(Fail)]`. --- [![Build Status](https://travis-ci.org/rust-lang-nursery/failure.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/failure) [![Latest Version](https://img.shields.io/crates/v/failure.svg)](https://crates.io/crates/failure) [![docs](https://docs.rs/failure/badge.svg)](https://docs.rs/failure) `failure` is designed to make it easier to manage errors in Rust. It is intended to replace error management based on `std::error::Error` with a new system based on lessons learned over the past several years, including those learned from experience with quick-error and error-chain. `failure` provides two core components: * `Fail`: A new trait for custom error types. * `Error`: A struct which any type that implements `Fail` can be cast into. ## Evolution Failure is currently evolving as a library. First of all there is work going on in Rust itself to [fix the error trait](https://github.com/rust-lang/rfcs/pull/2504) secondarily the original plan for Failure towards 1.0 is unlikely to happen in the current form. As such the original master branch towards 1.0 of failure was removed and master now represents the future iteration steps of 0.1 until it's clear what happens in the stdlib. The original 1.0 branch can be found in [evolution/1.0](https://github.com/rust-lang-nursery/failure/tree/evolution/1.0). ## Example ```rust extern crate serde; extern crate toml; #[macro_use] extern crate failure; #[macro_use] extern crate serde_derive; use std::collections::HashMap; use std::path::PathBuf; use std::str::FromStr; use failure::Error; // This is a new error type that you've created. It represents the ways a // toolchain could be invalid. // // The custom derive for Fail derives an impl of both Fail and Display. // We don't do any other magic like creating new types. #[derive(Debug, Fail)] enum ToolchainError { #[fail(display = "invalid toolchain name: {}", name)] InvalidToolchainName { name: String, }, #[fail(display = "unknown toolchain version: {}", version)] UnknownToolchainVersion { version: String, } } pub struct ToolchainId { // ... etc } impl FromStr for ToolchainId { type Err = ToolchainError; fn from_str(s: &str) -> Result { // ... etc } } pub type Toolchains = HashMap; // This opens a toml file containing associations between ToolchainIds and // Paths (the roots of those toolchains). // // This could encounter an io Error, a toml parsing error, or a ToolchainError, // all of them will be thrown into the special Error type pub fn read_toolchains(path: PathBuf) -> Result { use std::fs::File; use std::io::Read; let mut string = String::new(); File::open(path)?.read_to_string(&mut string)?; let toml: HashMap = toml::from_str(&string)?; let toolchains = toml.iter().map(|(key, path)| { let toolchain_id = key.parse()?; Ok((toolchain_id, path)) }).collect::>()?; Ok(toolchains) } ``` ## Requirements Both failure and failure_derive are intended to compile on all stable versions of Rust newer than 1.31.0, as well as the latest beta and the latest nightly. If either crate fails to compile on any version newer than 1.31.0, please open an issue. failure is **no_std** compatible, though some aspects of it (primarily the `Error` type) will not be available in no_std mode. ## License failure is licensed under the terms of the MIT License or the Apache License 2.0, at your choosing. ## Code of Conduct Contribution to the failure crate is organized under the terms of the Contributor Covenant, the maintainer of failure, @withoutboats, promises to intervene to uphold that code of conduct. ## Files: rust/vendor/fd-lock/README.md # fd-lock [![crates.io version][1]][2] [![downloads][5]][6] [![docs.rs docs][7]][8] Advisory cross-platform file locks using file descriptors. Adapted from [mafintosh/fd-lock]. Note that advisory lock compliance is opt-in, and can freely be ignored by other parties. This means this crate __should never be used for security purposes__, but solely to coordinate file access. [mafintosh/fd-lock]: https://github.com/mafintosh/fd-lock - [Documentation][8] - [Crates.io][2] - [Releases][releases] ## Examples __Basic usage__ ```rust use std::io::prelude::*; use std::fs::File; use fd_lock::RwLock; // Lock a file and write to it. let mut f = RwLock::new(File::open("foo.txt")?); write!(f.write()?, "chashu cat")?; // A lock can also be held across multiple operations. let mut f = f.write()?; write!(f, "nori cat")?; write!(f, "bird!")?; ``` ## Installation ```sh $ cargo add fd-lock ``` ## Safety This crate uses `unsafe` on Windows to interface with `windows-sys`. All invariants have been carefully checked, and are manually enforced. ## Contributing Want to join us? Check out our ["Contributing" guide][contributing] and take a look at some of these issues: - [Issues labeled "good first issue"][good-first-issue] - [Issues labeled "help wanted"][help-wanted] ## References - [LockFile function - WDC](https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-lockfile) - [flock(2) - Linux Man Page](https://man7.org/linux/man-pages/man2/flock.2.html) - [`rustix::fs::flock`](https://docs.rs/rustix/*/rustix/fs/fn.flock.html) - [`windows_sys::Win32::Storage::FileSystem::LockFile`](https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Storage/FileSystem/fn.LockFile.html) ## License [MIT](./LICENSE-MIT) OR [Apache-2.0](./LICENSE-APACHE) [1]: https://img.shields.io/crates/v/fd-lock.svg?style=flat-square [2]: https://crates.io/crates/fd-lock [3]: https://img.shields.io/travis/yoshuawuyts/fd-lock/master.svg?style=flat-square [4]: https://travis-ci.org/yoshuawuyts/fd-lock [5]: https://img.shields.io/crates/d/fd-lock.svg?style=flat-square [6]: https://crates.io/crates/fd-lock [7]: https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square [8]: https://docs.rs/fd-lock [releases]: https://github.com/yoshuawuyts/fd-lock/releases [contributing]: https://github.com/yoshuawuyts/fd-lock/blob/master.github/CONTRIBUTING.md [good-first-issue]: https://github.com/yoshuawuyts/fd-lock/labels/good%20first%20issue [help-wanted]: https://github.com/yoshuawuyts/fd-lock/labels/help%20wanted ## Files: rust/vendor/flate2/README.md # flate2 [![Crates.io](https://img.shields.io/crates/v/flate2.svg?maxAge=2592000)](https://crates.io/crates/flate2) [![Documentation](https://docs.rs/flate2/badge.svg)](https://docs.rs/flate2) A streaming compression/decompression library DEFLATE-based streams in Rust. This crate by default uses the `miniz_oxide` crate, a port of `miniz.c` to pure Rust. This crate also supports other [backends](#backends), such as the widely available zlib library or the high-performance zlib-ng library. Supported formats: * deflate * zlib * gzip ```toml # Cargo.toml [dependencies] flate2 = "1.0" ``` ## MSRV (Minimum Supported Rust Version) Policy This crate supports the current and previous stable versions of the Rust compiler. For example, if the current stable is 1.80, this crate supports 1.80 and 1.79. Other compiler versions may work, but failures may not be treated as a `flate2` bug. The `Cargo.toml` file specifies a `rust-version` for which builds of the current version passed at some point. This value is indicative only, and may change at any time. The `rust-version` is a best-effort measured value and is different to the MSRV. The `rust-version` can be incremented by a PR in order to pass tests, as long as the MSRV continues to hold. When the `rust-version` increases, the next release should be a minor version, to allow any affected users to pin to a previous minor version. ## Compression ```rust use std::io::prelude::*; use flate2::Compression; use flate2::write::ZlibEncoder; fn main() { let mut e = ZlibEncoder::new(Vec::new(), Compression::default()); e.write_all(b"foo"); e.write_all(b"bar"); let compressed_bytes = e.finish(); } ``` ## Decompression ```rust,no_run use std::io::prelude::*; use flate2::read::GzDecoder; fn main() { let mut d = GzDecoder::new("...".as_bytes()); let mut s = String::new(); d.read_to_string(&mut s).unwrap(); println!("{}", s); } ``` ## Backends The default `miniz_oxide` backend has the advantage of being pure Rust. If you want maximum performance, you can use the zlib-ng C library: ```toml [dependencies] flate2 = { version = "1.0.17", features = ["zlib-ng"], default-features = false } ``` Note that the `"zlib-ng"` feature works even if some other part of your crate graph depends on zlib. However, if you're already using another C or Rust library that depends on zlib, and you want to avoid including both zlib and zlib-ng, you can use that for Rust code as well: ```toml [dependencies] flate2 = { version = "1.0.17", features = ["zlib"], default-features = false } ``` Or, if you have C or Rust code that depends on zlib and you want to use zlib-ng via libz-sys in zlib-compat mode, use: ```toml [dependencies] flate2 = { version = "1.0.17", features = ["zlib-ng-compat"], default-features = false } ``` Note that when using the `"zlib-ng-compat"` feature, if any crate in your dependency graph explicitly requests stock zlib, or uses libz-sys directly without `default-features = false`, you'll get stock zlib rather than zlib-ng. See [the libz-sys README](https://github.com/rust-lang/libz-sys/blob/main/README.md) for details. To avoid that, use the `"zlib-ng"` feature instead. For compatibility with previous versions of `flate2`, the Cloudflare optimized version of zlib is available, via the `cloudflare_zlib` feature. It's not as fast as zlib-ng, but it's faster than stock zlib. It requires an x86-64 CPU with SSE 4.2 or ARM64 with NEON & CRC. It does not support 32-bit CPUs at all and is incompatible with mingw. For more information check the [crate documentation](https://crates.io/crates/cloudflare-zlib-sys). Note that `cloudflare_zlib` will cause breakage if any other crate in your crate graph uses another version of zlib/libz. # License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/foldhash/LICENSE Copyright (c) 2024 Orson Peters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ## Files: rust/vendor/futures/README.md

futures-rs

Zero-cost asynchronous programming in Rust

Build Status crates.io

Documentation | Website

`futures-rs` is a library providing the foundations for asynchronous programming in Rust. It includes key trait definitions like `Stream`, as well as utilities like `join!`, `select!`, and various futures combinator methods which enable expressive asynchronous control flow. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures = "0.3" ``` The current `futures` requires Rust 1.56 or later. ### Feature `std` Futures-rs works without the standard library, such as in bare metal environments. However, it has a significantly reduced API surface. To use futures-rs in a `#[no_std]` environment, use: ```toml [dependencies] futures = { version = "0.3", default-features = false } ``` ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-channel/README.md # futures-channel Channels for asynchronous communication using futures-rs. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures-channel = "0.3" ``` The current `futures-channel` requires Rust 1.56 or later. ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-core/README.md # futures-core The core traits and types in for the `futures` library. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures-core = "0.3" ``` The current `futures-core` requires Rust 1.36 or later. ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-executor/README.md # futures-executor Executors for asynchronous tasks based on the futures-rs library. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures-executor = "0.3" ``` The current `futures-executor` requires Rust 1.56 or later. ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-io/README.md # futures-io The `AsyncRead`, `AsyncWrite`, `AsyncSeek`, and `AsyncBufRead` traits for the futures-rs library. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures-io = "0.3" ``` The current `futures-io` requires Rust 1.36 or later. ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-sink/README.md # futures-sink The asynchronous `Sink` trait for the futures-rs library. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures-sink = "0.3" ``` The current `futures-sink` requires Rust 1.36 or later. ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-task/README.md # futures-task Tools for working with tasks. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures-task = "0.3" ``` The current `futures-task` requires Rust 1.56 or later. ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-timer/README.md

futures-timer

Timeouts for futures.

## Installation With [cargo add][cargo-add] installed run: ```sh $ cargo add futures-timer ``` [cargo-add]: https://github.com/killercup/cargo-edit ## Safety This crate makes use of carefully checked `unsafe` blocks to construct an efficient timer implementation. ## Contributing Want to join us? Check out our ["Contributing" guide][contributing] and take a look at some of these issues: - [Issues labeled "good first issue"][good-first-issue] - [Issues labeled "help wanted"][help-wanted] [contributing]: https://github.com/async-rs/futures-timer/blob/master.github/CONTRIBUTING.md [good-first-issue]: https://github.com/async-rs/futures-timer/labels/good%20first%20issue [help-wanted]: https://github.com/async-rs/futures-timer/labels/help%20wanted ## License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/futures-util/README.md # futures-util Common utilities and extension traits for the futures-rs library. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] futures-util = "0.3" ``` The current `futures-util` requires Rust 1.56 or later. ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/getrandom/README.md # getrandom [![Build Status]][GitHub Actions] [![Crate]][crates.io] [![Documentation]][docs.rs] [![Dependency Status]][deps.rs] [![Downloads]][crates.io] [![License]][LICENSE-MIT] [GitHub Actions]: https://github.com/rust-random/getrandom/actions?query=workflow:Tests+branch:master [Build Status]: https://github.com/rust-random/getrandom/actions/workflows/tests.yml/badge.svg?branch=master [crates.io]: https://crates.io/crates/getrandom [Crate]: https://img.shields.io/crates/v/getrandom [docs.rs]: https://docs.rs/getrandom [Documentation]: https://docs.rs/getrandom/badge.svg [deps.rs]: https://deps.rs/repo/github/rust-random/getrandom [Dependency Status]: https://deps.rs/repo/github/rust-random/getrandom/status.svg [Downloads]: https://img.shields.io/crates/d/getrandom [LICENSE-MIT]: https://raw.githubusercontent.com/rust-random/getrandom/master/LICENSE-MIT [License]: https://img.shields.io/crates/l/getrandom A Rust library for retrieving random data from (operating) system sources. It is assumed that the system always provides high-quality cryptographically secure random data, ideally backed by hardware entropy sources. This crate derives its name from Linux's `getrandom` function, but is cross-platform, roughly supporting the same set of platforms as Rust's `std` lib. This is a low-level API. Most users should prefer using high-level random-number library like [`rand`]. [`rand`]: https://crates.io/crates/rand ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] getrandom = "0.2" ``` Then invoke the `getrandom` function: ```rust fn get_random_buf() -> Result<[u8; 32], getrandom::Error> { let mut buf = [0u8; 32]; getrandom::getrandom(&mut buf)?; Ok(buf) } ``` For more information about supported targets, entropy sources, `no_std` targets, crate features, WASM support and Custom RNGs see the [`getrandom` documentation](https://docs.rs/getrandom/latest) and [`getrandom::Error` documentation](https://docs.rs/getrandom/latest/getrandom/struct.Error.html). ## Minimum Supported Rust Version This crate requires Rust 1.36.0 or later. ## Platform Support This crate generally supports the same operating system and platform versions that the Rust standard library does. Additional targets may be supported using pluggable custom implementations. This means that as Rust drops support for old versions of operating systems (such as old Linux kernel versions, Android API levels, etc) in stable releases, `getrandom` may create new patch releases (`0.N.x`) that remove support for outdated platform versions. ## License The `getrandom` library is distributed under either of * [Apache License, Version 2.0][LICENSE-APACHE] * [MIT license][LICENSE-MIT] at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [LICENSE-APACHE]: https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE [LICENSE-MIT]: https://github.com/rust-random/getrandom/blob/master/LICENSE-MIT ## Files: rust/vendor/ghash/README.md # RustCrypto: GHASH [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Build Status][build-image]][build-link] [GHASH][1] is a [universal hash function][2] which operates over GF(2^128) and can be used for constructing a [Message Authentication Code (MAC)][3]. Its primary intended use is for implementing [AES-GCM][4]. [Documentation][docs-link] ## Security Notes This crate has received one [security audit by NCC Group][5], with no significant findings. We would like to thank [MobileCoin][6] for funding the audit. All implementations contained in the crate are designed to execute in constant time, either by relying on hardware intrinsics (i.e. AVX2 on x86/x86_64), or using a portable implementation which is only constant time on processors which implement constant-time multiplication. It is not suitable for use on processors with a variable-time multiplication operation (e.g. short circuit on multiply-by-zero / multiply-by-one, such as certain 32-bit PowerPC CPUs and some non-ARM microcontrollers). ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/ghash.svg [crate-link]: https://crates.io/crates/ghash [docs-image]: https://docs.rs/ghash/badge.svg [docs-link]: https://docs.rs/ghash/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.49+-blue.svg [build-image]: https://github.com/RustCrypto/universal-hashes/workflows/ghash/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/universal-hashes/actions?query=workflow%3Aghash [//]: # (footnotes) [1]: https://en.wikipedia.org/wiki/Galois/Counter_Mode#Mathematical_basis [2]: https://en.wikipedia.org/wiki/Universal_hashing [3]: https://en.wikipedia.org/wiki/Message_authentication_code [4]: https://en.wikipedia.org/wiki/Galois/Counter_Mode [5]: https://research.nccgroup.com/2020/02/26/public-report-rustcrypto-aes-gcm-and-chacha20poly1305-implementation-review/ [6]: https://www.mobilecoin.com/ ## Files: rust/vendor/hashbrown/README.md hashbrown ========= [![Build Status](https://github.com/rust-lang/hashbrown/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-lang/hashbrown/actions) [![Crates.io](https://img.shields.io/crates/v/hashbrown.svg)](https://crates.io/crates/hashbrown) [![Documentation](https://docs.rs/hashbrown/badge.svg)](https://docs.rs/hashbrown) [![Rust](https://img.shields.io/badge/rust-1.65.0%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/hashbrown) This crate is a Rust port of Google's high-performance [SwissTable] hash map, adapted to make it a drop-in replacement for Rust's standard `HashMap` and `HashSet` types. The original C++ version of SwissTable can be found [here], and this [CppCon talk] gives an overview of how the algorithm works. Since Rust 1.36, this is now the `HashMap` implementation for the Rust standard library. However you may still want to use this crate instead since it works in environments without `std`, such as embedded systems and kernels. [SwissTable]: https://abseil.io/blog/20180927-swisstables [here]: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/raw_hash_set.h [CppCon talk]: https://www.youtube.com/watch?v=ncHmEUmJZf4 ## [Change log](CHANGELOG.md) ## Features - Drop-in replacement for the standard library `HashMap` and `HashSet` types. - Uses [foldhash](https://github.com/orlp/foldhash) as the default hasher, which is much faster than SipHash. However, foldhash does *not provide the same level of HashDoS resistance* as SipHash, so if that is important to you, you might want to consider using a different hasher. - Around 2x faster than the previous standard library `HashMap`. - Lower memory usage: only 1 byte of overhead per entry instead of 8. - Compatible with `#[no_std]` (but requires a global allocator with the `alloc` crate). - Empty hash maps do not allocate any memory. - SIMD lookups to scan multiple hash entries in parallel. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] hashbrown = "0.15" ``` Then: ```rust use hashbrown::HashMap; let mut map = HashMap::new(); map.insert(1, "one"); ``` ## Flags This crate has the following Cargo features: - `nightly`: Enables nightly-only features including: `#[may_dangle]`. - `serde`: Enables serde serialization support. - `rayon`: Enables rayon parallel iterator support. - `equivalent`: Allows comparisons to be customized with the `Equivalent` trait. (enabled by default) - `raw-entry`: Enables access to the deprecated `RawEntry` API. - `inline-more`: Adds inline hints to most functions, improving run-time performance at the cost of compilation time. (enabled by default) - `default-hasher`: Compiles with foldhash as default hasher. (enabled by default) - `allocator-api2`: Enables support for allocators that support `allocator-api2`. (enabled by default) ## License Licensed under either of: * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/heck/README.md # **heck** is a case conversion library !["I specifically requested the opposite of this."](./no_step_on_snek.png) This library exists to provide case conversion between common cases like CamelCase and snake_case. It is intended to be unicode aware, internally consistent, and reasonably well performing. ## Definition of a word boundary Word boundaries are defined by non-alphanumeric characters, as well as within those words in this manner: 1. If an uppercase character is followed by lowercase letters, a word boundary is considered to be just prior to that uppercase character. 2. If multiple uppercase characters are consecutive, they are considered to be within a single word, except that the last will be part of the next word if it is followed by lowercase characters (see rule 1). That is, "HelloWorld" is segmented `Hello|World` whereas "XMLHttpRequest" is segmented `XML|Http|Request`. Characters not within words (such as spaces, punctuations, and underscores) are not included in the output string except as they are a part of the case being converted to. Multiple adjacent word boundaries (such as a series of underscores) are folded into one. ("hello__world" in snake case is therefore "hello_world", not the exact same string). Leading or trailing word boundary indicators are dropped, except insofar as CamelCase capitalizes the first word. ## Cases contained in this library: 1. UpperCamelCase 2. lowerCamelCase 3. snake_case 4. kebab-case 5. SHOUTY_SNAKE_CASE 6. Title Case 7. SHOUTY-KEBAB-CASE 8. Train-Case ## MSRV The minimum supported Rust version for this crate is 1.56.0. This may change in minor or patch releases, but we probably won't ever require a very recent version. If you would like to have a stronger guarantee than that, please open an issue. ## License heck is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details. ## Files: rust/vendor/hex/README.md # hex [![Crates.io: hex](https://img.shields.io/crates/v/hex.svg)](https://crates.io/crates/hex) [![Documentation](https://docs.rs/hex/badge.svg)](https://docs.rs/hex) [![Build Status (Github Actions)](https://github.com/KokaKiwi/rust-hex/workflows/Test%20hex/badge.svg?master)](https://github.com/KokaKiwi/rust-hex/actions) Encoding and decoding data into/from hexadecimal representation. ## Examples Encoding a `String` ```rust let hex_string = hex::encode("Hello world!"); println!("{}", hex_string); // Prints "48656c6c6f20776f726c6421" ``` Decoding a `String` ```rust let decoded_string = hex::decode("48656c6c6f20776f726c6421"); println!("{}", decoded_string); // Prints "Hello world!" ``` You can find the [documentation](https://docs.rs/hex) here. ## Installation In order to use this crate, you have to add it under `[dependencies]` to your `Cargo.toml` ```toml [dependencies] hex = "0.4" ``` By default this will import `std`, if you are working in a [`no_std`](https://rust-embedded.github.io/book/intro/no-std.html) environment you can turn this off by adding the following ```toml [dependencies] hex = { version = "0.4", default-features = false } ``` ## Features - `std`: Enabled by default. Add support for Rust's libstd types. - `serde`: Disabled by default. Add support for `serde` de/serializing library. See the `serde` module documentation for usage. ## License Licensed under either of - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/hkdf/README.md # RustCrypto: HKDF [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Pure Rust implementation of the [HMAC-based Extract-and-Expand Key Derivation Function (HKDF)](https://tools.ietf.org/html/rfc5869) generic over hash function. # Usage The most common way to use HKDF is as follows: you provide the Initial Key Material (IKM) and an optional salt, then you expand it (perhaps multiple times) into some Output Key Material (OKM) bound to an "info" context string. ```rust use sha2::Sha256; use hkdf::Hkdf; use hex_literal::hex; let ikm = hex!("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"); let salt = hex!("000102030405060708090a0b0c"); let info = hex!("f0f1f2f3f4f5f6f7f8f9"); let hk = Hkdf::::new(Some(&salt[..]), &ikm); let mut okm = [0u8; 42]; hk.expand(&info, &mut okm) .expect("42 is a valid length for Sha256 to output"); let expected = hex!(" 3cb25f25faacd57a90434f64d0362f2a 2d2d0a90cf1a5a4c5db02d56ecc4c5bf 34007208d5b887185865 "); assert_eq!(okm, expected); ``` Normally the PRK (Pseudo-Random Key) remains hidden within the HKDF object, but if you need to access it, use `Hkdf::extract` instead of `Hkdf::new`. ```rust let (prk, hk) = Hkdf::::extract(Some(&salt[..]), &ikm); let expected = hex!(" 077709362c2e32df0ddc3f0dc47bba63 90b6c73bb50f9c3122ec844ad7c2b3e5 "); assert_eq!(prk[..], expected[..]); ``` If you already have a strong key to work from (uniformly-distributed and long enough), you can save a tiny amount of time by skipping the extract step. In this case, you pass a Pseudo-Random Key (PRK) into the `Hkdf::from_prk` constructor, then use the resulting `Hkdf` object as usual. ```rust let prk = hex!(" 077709362c2e32df0ddc3f0dc47bba63 90b6c73bb50f9c3122ec844ad7c2b3e5 "); let hk = Hkdf::::from_prk(&prk).expect("PRK should be large enough"); let mut okm = [0u8; 42]; hk.expand(&info, &mut okm) .expect("42 is a valid length for Sha256 to output"); let expected = hex!(" 3cb25f25faacd57a90434f64d0362f2a 2d2d0a90cf1a5a4c5db02d56ecc4c5bf 34007208d5b887185865 "); assert_eq!(okm, expected); ``` [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/hkdf.svg [crate-link]: https://crates.io/crates/hkdf [docs-image]: https://docs.rs/hkdf/badge.svg [docs-link]: https://docs.rs/hkdf/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260043-KDFs [build-image]: https://github.com/RustCrypto/KDFs/workflows/hkdf/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/KDFs/actions?query=workflow:hkdf ## Files: rust/vendor/hmac/README.md # RustCrypto: HMAC [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] Pure Rust implementation of the [Hash-based Message Authentication Code (HMAC)][1]. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/hmac.svg [crate-link]: https://crates.io/crates/hmac [docs-image]: https://docs.rs/hmac/badge.svg [docs-link]: https://docs.rs/hmac/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260044-MACs [//]: # (general links) [1]: https://en.wikipedia.org/wiki/HMAC ## Files: rust/vendor/home/README.md [![Documentation](https://docs.rs/home/badge.svg)](https://docs.rs/home) [![crates.io](https://img.shields.io/crates/v/home.svg)](https://crates.io/crates/home) Canonical definitions of `home_dir`, `cargo_home`, and `rustup_home`. This provides the definition of `home_dir` used by Cargo and rustup, as well functions to find the correct value of `CARGO_HOME` and `RUSTUP_HOME`. The definition of `home_dir` provided by the standard library is incorrect because it considers the `HOME` environment variable on Windows. This causes surprising situations where a Rust program will behave differently depending on whether it is run under a Unix emulation environment like Cygwin or MinGW. Neither Cargo nor rustup use the standard library's definition - they use the definition here. This crate further provides two functions, `cargo_home` and `rustup_home`, which are the canonical way to determine the location that Cargo and rustup store their data. See [rust-lang/rust#43321]. [rust-lang/rust#43321]: https://github.com/rust-lang/rust/issues/43321 ## License MIT OR Apache-2.0 ## Files: rust/vendor/itoa/README.md itoa ==== [github](https://github.com/dtolnay/itoa) [crates.io](https://crates.io/crates/itoa) [docs.rs](https://docs.rs/itoa) [build status](https://github.com/dtolnay/itoa/actions?query=branch%3Amaster) This crate provides a fast conversion of integer primitives to decimal strings. The implementation comes straight from [libcore] but avoids the performance penalty of going through [`core::fmt::Formatter`]. See also [`ryu`] for printing floating point primitives. *Version requirement: rustc 1.36+* [libcore]: https://github.com/rust-lang/rust/blob/b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89/src/libcore/fmt/num.rs#L201-L254 [`core::fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html [`ryu`]: https://github.com/dtolnay/ryu ```toml [dependencies] itoa = "1.0" ```
## Example ```rust fn main() { let mut buffer = itoa::Buffer::new(); let printed = buffer.format(128u64); assert_eq!(printed, "128"); } ```
## Performance (lower is better) ![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png)
#### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/kerberos-parser/README.md # Kerberos parser [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![Build Status](https://travis-ci.org/rusticata/kerberos-parser.svg?branch=master)](https://travis-ci.org/rusticata/kerberos-parser) [![Crates.io Version](https://img.shields.io/crates/v/kerberos-parser.svg)](https://crates.io/crates/kerberos-parser) # Kerberos Parser A Kerberos v5 ([RFC4120]) parser, implemented with the [nom](https://github.com/Geal/nom) parser combinator framework. The code is available on [Github](https://github.com/rusticata/kerberos-parser). Specific parsing functions are provided for Kerberos message types. For ex. to parse a KRB_AS_REQ message, use [`parse_as_req`](krb5_parser/fn.parse_as_req.html). # Examples Parsing a KRB_AS_REQ message: ```rust,no_run use kerberos_parser::krb5::MessageType; use kerberos_parser::krb5_parser::parse_as_req; static AS_REQ: &'static [u8] = include_bytes!("../assets/as-req.bin"); let res = parse_as_req(AS_REQ); match res { Ok((rem, kdc_req)) => { assert!(rem.is_empty()); // assert_eq!(kdc_req.msg_type, MessageType::KRB_AS_REQ); }, _ => panic!("KRB_AS_REQ parsing failed: {:?}", res), } ``` [RFC4120]: https://tools.ietf.org/html/rfc4120 ## Rusticata This parser is part of the [rusticata](https://github.com/rusticata) project. The goal of this project is to provide **safe** parsers, that can be used in other projects. Testing of the parser is done manually, and also using unit tests and [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz). Please fill a bugreport if you find any issue. Feel free to contribute: tests, feedback, doc, suggestions (or code) of new parsers etc. are welcome. ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/lazy_static/README.md lazy-static.rs ============== A macro for declaring lazily evaluated statics in Rust. Using this macro, it is possible to have `static`s that require code to be executed at runtime in order to be initialized. This includes anything requiring heap allocations, like vectors or hash maps, as well as anything that requires non-const function calls to be computed. [![Rust](https://github.com/rust-lang-nursery/lazy-static.rs/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-lang-nursery/lazy-static.rs/actions/workflows/rust.yml) [![Latest version](https://img.shields.io/crates/v/lazy_static.svg)](https://crates.io/crates/lazy_static) [![Documentation](https://docs.rs/lazy_static/badge.svg)](https://docs.rs/lazy_static) [![License](https://img.shields.io/crates/l/lazy_static.svg)](https://github.com/rust-lang-nursery/lazy-static.rs#license) ## Minimum supported `rustc` `1.40.0+` This version is explicitly tested in CI and may only be bumped in new minor versions. Any changes to the supported minimum version will be called out in the release notes. # Getting Started [lazy-static.rs is available on crates.io](https://crates.io/crates/lazy_static). It is recommended to look there for the newest released version, as well as links to the newest builds of the docs. At the point of the last update of this README, the latest published version could be used like this: Add the following dependency to your Cargo manifest... ```toml [dependencies] lazy_static = "1.5.0" ``` ...and see the [docs](https://docs.rs/lazy_static) for how to use it. # Example ```rust use lazy_static::lazy_static; use std::collections::HashMap; lazy_static! { static ref HASHMAP: HashMap = { let mut m = HashMap::new(); m.insert(0, "foo"); m.insert(1, "bar"); m.insert(2, "baz"); m }; } fn main() { // First access to `HASHMAP` initializes it println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap()); // Any further access to `HASHMAP` just returns the computed value println!("The entry for `1` is \"{}\".", HASHMAP.get(&1).unwrap()); } ``` # Standard library It is now possible to easily replicate this crate's functionality in Rust's standard library with [`std::sync::OnceLock`](https://doc.rust-lang.org/std/sync/struct.OnceLock.html). The example above could be also be written as: ```rust use std::collections::HashMap; use std::sync::OnceLock; fn hashmap() -> &'static HashMap { static HASHMAP: OnceLock> = OnceLock::new(); HASHMAP.get_or_init(|| { let mut m = HashMap::new(); m.insert(0, "foo"); m.insert(1, "bar"); m.insert(2, "baz"); m }) } fn main() { // First access to `HASHMAP` initializes it println!("The entry for `0` is \"{}\".", hashmap().get(&0).unwrap()); // Any further access to `HASHMAP` just returns the computed value println!("The entry for `1` is \"{}\".", hashmap().get(&1).unwrap()); } ``` ## License Licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/ldap-parser/README.md [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![docs.rs](https://docs.rs/ldap-parser/badge.svg)](https://docs.rs/ldap-parser) [![crates.io](https://img.shields.io/crates/v/ldap-parser.svg)](https://crates.io/crates/ldap-parser) [![Github CI](https://github.com/rusticata/ldap-parser/workflows/Continuous%20integration/badge.svg)](https://github.com/rusticata/ldap-parser/actions) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.44.0+-lightgray.svg)](#rust-version-requirements) # LDAP Parser A Lightweight Directory Access Protocol (LDAP) ([RFC4511]) parser, implemented with the [nom](https://github.com/Geal/nom) parser combinator framework. It is written in pure Rust, fast, and makes extensive use of zero-copy. A lot of care is taken to ensure security and safety of this crate, including design (recursion limit, defensive programming), tests, and fuzzing. It also aims to be panic-free. The code is available on [Github](https://github.com/rusticata/ldap-parser) and is part of the [Rusticata](https://github.com/rusticata) project. # Examples Parsing an LDAP message (in BER format): ```rust use ldap_parser::parse_ldap_message; use ldap_parser::ldap::{MessageID, ProtocolOp, ProtocolOpTag}; static DATA: &[u8] = include_bytes!("../assets/message-search-request-01.bin"); let res = parse_ldap_message(DATA); match res { Ok((rem, msg)) => { assert!(rem.is_empty()); // assert_eq!(msg.message_id, MessageID(4)); assert_eq!(msg.protocol_op.tag(), ProtocolOpTag::SearchRequest); match msg.protocol_op { ProtocolOp::SearchRequest(req) => { assert_eq!(req.base_object.0, "dc=rccad,dc=net"); }, _ => panic!("Unexpected message type"), } }, _ => panic!("LDAP parsing failed: {:?}", res), } ``` [RFC4511]: https://tools.ietf.org/html/rfc4511 ## Changes See [CHANGELOG.md](CHANGELOG.md) # License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/libc/README.md # libc - Raw FFI bindings to platforms' system libraries [![GHA Status]][GitHub Actions] [![Cirrus CI Status]][Cirrus CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License] `libc` provides all of the definitions necessary to easily interoperate with C code (or "C-like" code) on each of the platforms that Rust supports. This includes type definitions (e.g. `c_int`), constants (e.g. `EINVAL`) as well as function headers (e.g. `malloc`). This crate exports all underlying platform types, functions, and constants under the crate root, so all items are accessible as `libc::foo`. The types and values of all the exported APIs match the platform that libc is compiled for. Windows API bindings are not included in this crate. If you are looking for WinAPI bindings, consider using crates like [windows-sys]. More detailed information about the design of this library can be found in its [associated RFC][rfc]. [rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md [windows-sys]: https://docs.rs/windows-sys ## v1.0 Roadmap Currently, `libc` has two active branches: `main` for the upcoming v1.0 release, and `libc-0.2` for the currently published version. By default all pull requests should target `main`; once reviewed, they can be cherry picked to the `libc-0.2` branch if needed. We will stop making new v0.2 releases once v1.0 is released. See the section in [CONTRIBUTING.md](CONTRIBUTING.md#v10-roadmap) for more details. ## Usage Add the following to your `Cargo.toml`: ```toml [dependencies] libc = "0.2" ``` ## Features * `std`: by default `libc` links to the standard library. Disable this feature to remove this dependency and be able to use `libc` in `#![no_std]` crates. * `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`. This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`. The following features are deprecated: * `use_std`: this is equivalent to `std` * `const-extern-fn`: this is now enabled by default * `align`: this is now enabled by default ## Rust version support The minimum supported Rust toolchain version is currently **Rust 1.63**. Increases to the MSRV are allowed to change without a major (i.e. semver- breaking) release in order to avoid a ripple effect in the ecosystem. A policy for when this may change is a work in progress. `libc` may continue to compile with Rust versions older than the current MSRV but this is not guaranteed. ## Platform support You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see. See [`ci/verify-build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/verify-build.sh) for the platforms on which `libc` is guaranteed to build for each Rust toolchain. The test-matrix at [GitHub Actions] and [Cirrus CI] show the platforms in which `libc` tests are run.
## License This project is licensed under either of * [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([LICENSE-APACHE](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-APACHE)) * [MIT License](https://opensource.org/licenses/MIT) ([LICENSE-MIT](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-MIT)) at your option. ## Contributing We welcome all people who want to contribute. Please see the [contributing instructions] for more information. [contributing instructions]: https://github.com/rust-lang/libc/blob/HEAD/CONTRIBUTING.md Contributions in any form (issues, pull requests, etc.) to this project must adhere to Rust's [Code of Conduct]. [Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [GitHub Actions]: https://github.com/rust-lang/libc/actions [GHA Status]: https://github.com/rust-lang/libc/workflows/CI/badge.svg [Cirrus CI]: https://cirrus-ci.com/github/rust-lang/libc [Cirrus CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg [crates.io]: https://crates.io/crates/libc [Latest Version]: https://img.shields.io/crates/v/libc.svg [Documentation]: https://docs.rs/libc/badge.svg [docs.rs]: https://docs.rs/libc [License]: https://img.shields.io/crates/l/libc.svg ## Files: rust/vendor/libz-sys/README.md # libz-sys A common library for linking `libz` to Rust programs (also known as zlib). [Documentation](https://docs.rs/libz-sys) This also serves as the source for the `libz-ng-sys` crate, which builds zlib-ng natively (not in zlib-compat mode). See [`README-zng.md`](README-zng.md) for details. # High-level API This crate provides bindings to the raw low-level C API. For a higher-level safe API to work with DEFLATE, zlib, or gzip streams, see [`flate2`](https://docs.rs/flate2). `flate2` also supports alternative implementations, including slower but pure Rust implementations. # zlib-ng This crate supports building either the high-performance zlib-ng (in zlib-compat mode), or the widely available stock zlib. By default, `libz-sys` uses stock zlib, primarily because doing so allows the use of a shared system zlib library if available. Any application or library designed for zlib should work with zlib-ng in zlib-compat mode, as long as it doesn't make assumptions about the exact size or output of the deflated data (e.g. "compressing this data produces exactly this many bytes"), and as long as you don't also dynamically pull in a copy of stock zlib (which will produce conflicting symbols). Nonetheless, for maximum compatibility, every library crate in a build must opt into allowing zlib-ng; if any library crate in your dependency graph wants stock zlib, `libz-sys` will use stock zlib. Library crates depending on `libz-sys` should use: ```toml libz-sys = { version = "1.1", default-features = false, features = ["libc"] } ``` (Omit the `libc` feature if you don't require the corresponding functions.) This allows higher-level crates depending on your library to opt into zlib-ng if desired. Building zlib-ng requires `cmake` unless the `zlib-ng-no-cmake-experimental-community-maintained` feature is enabled, in which case `cc` is used instead. Note that this option enables _all_ compiler features that are supported for the given target, which may not compile on older compilers or targets without certain headers. Crates that don't require compatibility with the zlib C API, and use zlib exclusively from Rust or support the zlib-ng native C API (prefixed with `zng_`) can use [`libz-ng-sys`](https://crates.io/crates/libz-ng-sys) instead, which allows zlib and zlib-ng to coexist in the same program. See [README-zng.md](README-zng.md) for details. # Minimum Supported Rust Version (MSRV) Policy This crate uses the same MSRV policy as the [`flate2`](https://crates.io/crates/flate2) crate: This crate supports the current and previous stable versions of Rust. Older versions of Rust may work, but we don't guarantee these will continue to work. # License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) * MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in `libz-sys` by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/libz-sys/src/zlib/LICENSE Copyright notice: (C) 1995-2022 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu ## Files: rust/vendor/log/README.md log === A Rust library providing a lightweight logging *facade*. [![Build status](https://img.shields.io/github/actions/workflow/status/rust-lang/log/main.yml?branch=master)](https://github.com/rust-lang/log/actions) [![Latest version](https://img.shields.io/crates/v/log.svg)](https://crates.io/crates/log) [![Documentation](https://docs.rs/log/badge.svg)](https://docs.rs/log) ![License](https://img.shields.io/crates/l/log.svg) * [`log` documentation](https://docs.rs/log) A logging facade provides a single logging API that abstracts over the actual logging implementation. Libraries can use the logging API provided by this crate, and the consumer of those libraries can choose the logging implementation that is most suitable for its use case. ## Minimum supported `rustc` `1.60.0+` This version is explicitly tested in CI and may be bumped in any release as needed. Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes. ## Usage ### In libraries Libraries should link only to the `log` crate, and use the provided macros to log whatever information will be useful to downstream consumers: ```toml [dependencies] log = "0.4" ``` ```rust use log::{info, trace, warn}; pub fn shave_the_yak(yak: &mut Yak) { trace!("Commencing yak shaving"); loop { match find_a_razor() { Ok(razor) => { info!("Razor located: {razor}"); yak.shave(razor); break; } Err(err) => { warn!("Unable to locate a razor: {err}, retrying"); } } } } ``` ### In executables In order to produce log output, executables have to use a logger implementation compatible with the facade. There are many available implementations to choose from, here are some options: * Simple minimal loggers: * [`env_logger`](https://docs.rs/env_logger/*/env_logger/) * [`colog`](https://docs.rs/colog/*/colog/) * [`simple_logger`](https://docs.rs/simple_logger/*/simple_logger/) * [`simplelog`](https://docs.rs/simplelog/*/simplelog/) * [`pretty_env_logger`](https://docs.rs/pretty_env_logger/*/pretty_env_logger/) * [`stderrlog`](https://docs.rs/stderrlog/*/stderrlog/) * [`flexi_logger`](https://docs.rs/flexi_logger/*/flexi_logger/) * [`call_logger`](https://docs.rs/call_logger/*/call_logger/) * [`std-logger`](https://docs.rs/std-logger/*/std_logger/) * [`structured-logger`](https://docs.rs/structured-logger/latest/structured_logger/) * [`clang_log`](https://docs.rs/clang_log/latest/clang_log) * [`ftail`](https://docs.rs/ftail/latest/ftail/) * Complex configurable frameworks: * [`log4rs`](https://docs.rs/log4rs/*/log4rs/) * [`logforth`](https://docs.rs/logforth/*/logforth/) * [`fern`](https://docs.rs/fern/*/fern/) * [`spdlog-rs`](https://docs.rs/spdlog-rs/*/spdlog/) * Adaptors for other facilities: * [`syslog`](https://docs.rs/syslog/*/syslog/) * [`systemd-journal-logger`](https://docs.rs/systemd-journal-logger/*/systemd_journal_logger/) * [`slog-stdlog`](https://docs.rs/slog-stdlog/*/slog_stdlog/) * [`android_log`](https://docs.rs/android_log/*/android_log/) * [`win_dbg_logger`](https://docs.rs/win_dbg_logger/*/win_dbg_logger/) * [`db_logger`](https://docs.rs/db_logger/*/db_logger/) * [`log-to-defmt`](https://docs.rs/log-to-defmt/*/log_to_defmt/) * [`logcontrol-log`](https://docs.rs/logcontrol-log/*/logcontrol_log/) * For WebAssembly binaries: * [`console_log`](https://docs.rs/console_log/*/console_log/) * For dynamic libraries: * You may need to construct [an FFI-safe wrapper over `log`](https://github.com/rust-lang/log/issues/421) to initialize in your libraries. * Utilities: * [`log_err`](https://docs.rs/log_err/*/log_err/) * [`log-reload`](https://docs.rs/log-reload/*/log_reload/) * [`alterable_logger`](https://docs.rs/alterable_logger/*/alterable_logger) Executables should choose a logger implementation and initialize it early in the runtime of the program. Logger implementations will typically include a function to do this. Any log messages generated before the logger is initialized will be ignored. The executable itself may use the `log` crate to log as well. ## Structured logging If you enable the `kv` feature, you can associate structured data with your log records: ```rust use log::{info, trace, warn}; pub fn shave_the_yak(yak: &mut Yak) { // `yak:serde` will capture `yak` using its `serde::Serialize` impl // // You could also use `:?` for `Debug`, or `:%` for `Display`. For a // full list, see the `log` crate documentation trace!(target = "yak_events", yak:serde; "Commencing yak shaving"); loop { match find_a_razor() { Ok(razor) => { info!(razor; "Razor located"); yak.shave(razor); break; } Err(e) => { // `e:err` will capture `e` using its `std::error::Error` impl warn!(e:err; "Unable to locate a razor, retrying"); } } } } ``` ## Files: rust/vendor/lru/README.md # LRU Cache [![Build Badge]][build status] [![Codecov Badge]][coverage status] [![crates.io Badge]][crates.io package] [![docs.rs Badge]][docs.rs documentation] [![License Badge]][license] [Documentation] An implementation of a LRU cache. The cache supports `put`, `get`, `get_mut` and `pop` operations, all of which are O(1). This crate was heavily influenced by the [LRU Cache implementation in an earlier version of Rust's std::collections crate]. The MSRV for this crate is 1.64.0. ## Example Below is a simple example of how to instantiate and use a LRU cache. ```rust,no_run extern crate lru; use lru::LruCache; use std::num::NonZeroUsize; fn main() { let mut cache = LruCache::new(NonZeroUsize::new(2).unwrap()); cache.put("apple", 3); cache.put("banana", 2); assert_eq!(*cache.get(&"apple").unwrap(), 3); assert_eq!(*cache.get(&"banana").unwrap(), 2); assert!(cache.get(&"pear").is_none()); assert_eq!(cache.put("banana", 4), Some(2)); assert_eq!(cache.put("pear", 5), None); assert_eq!(*cache.get(&"pear").unwrap(), 5); assert_eq!(*cache.get(&"banana").unwrap(), 4); assert!(cache.get(&"apple").is_none()); { let v = cache.get_mut(&"banana").unwrap(); *v = 6; } assert_eq!(*cache.get(&"banana").unwrap(), 6); } ``` [build badge]: https://github.com/jeromefroe/lru-rs/actions/workflows/main.yml/badge.svg [build status]: https://github.com/jeromefroe/lru-rs/actions/workflows/main.yml [codecov badge]: https://codecov.io/gh/jeromefroe/lru-rs/branch/master/graph/badge.svg [coverage status]: https://codecov.io/gh/jeromefroe/lru-rs [crates.io badge]: https://img.shields.io/crates/v/lru.svg [crates.io package]: https://crates.io/crates/lru/ [documentation]: https://docs.rs/lru/ [docs.rs badge]: https://docs.rs/lru/badge.svg [docs.rs documentation]: https://docs.rs/lru/ [license badge]: https://img.shields.io/badge/license-MIT-blue.svg [license]: https://raw.githubusercontent.com/jeromefroe/lru-rs/master/LICENSE [lru cache implementation in an earlier version of rust's std::collections crate]: https://doc.rust-lang.org/0.12.0/std/collections/lru_cache/struct.LruCache.html ## Files: rust/vendor/lzma-rs/README.md # lzma-rs [![Crate](https://img.shields.io/crates/v/lzma-rs.svg)](https://crates.io/crates/lzma-rs) [![Documentation](https://docs.rs/lzma-rs/badge.svg)](https://docs.rs/lzma-rs) [![Safety Dance](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) ![Build Status](https://github.com/gendx/lzma-rs/workflows/Build%20and%20run%20tests/badge.svg) [![Minimum rust 1.40](https://img.shields.io/badge/rust-1.40%2B-orange.svg)](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1400-2019-12-19) This project is a decoder for LZMA and its variants written in pure Rust, with focus on clarity. It already supports LZMA, LZMA2 and a subset of the `.xz` file format. ## Usage Decompress a `.xz` file. ```rust let filename = "foo.xz"; let mut f = std::io::BufReader::new(std::fs::File::open(filename).unwrap()); // "decomp" can be anything that implements "std::io::Write" let mut decomp: Vec = Vec::new(); lzma_rs::xz_decompress(&mut f, &mut decomp).unwrap(); // Decompressed content is now in "decomp" ``` ## Encoder For now, there is also a dumb encoder that only uses byte literals, with many hard-coded constants for code simplicity. Better encoders are welcome! ## Contributing Pull-requests are welcome, to improve the decoder, add better encoders, or more tests. Ultimately, this project should also implement .xz and .7z files. ## License MIT ## Files: rust/vendor/md-5/README.md # RustCrypto: MD5 [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Pure Rust implementation of the [MD5 hash function][1]. [Documentation][docs-link] ## ⚠️ Security Warning This crate is provided for the purposes of legacy interoperability with protocols and systems which mandate the use of MD5. However, MD5 is [cryptographically broken and unsuitable for further use][2]. Collision attacks against MD5 are both practical and trivial, and [theoretical attacks against MD5's preimage resistance have been found][3]. [RFC6151][4] advises no new IETF protocols can be designed MD5-based constructions, including HMAC-MD5. ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/md-5.svg [crate-link]: https://crates.io/crates/md-5 [docs-image]: https://docs.rs/md-5/badge.svg [docs-link]: https://docs.rs/md-5/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/md5/badge.svg?branch=master [build-link]: https://github.com/RustCrypto/hashes/actions?query=workflow%3Amd5 [//]: # (general links) [1]: https://en.wikipedia.org/wiki/MD5 [2]: https://www.kb.cert.org/vuls/id/836068 [3]: https://dl.acm.org/citation.cfm?id=1724151 [4]: https://tools.ietf.org/html/rfc6151 ## Files: rust/vendor/memchr/README.md memchr ====== This library provides heavily optimized routines for string search primitives. [![Build status](https://github.com/BurntSushi/memchr/workflows/ci/badge.svg)](https://github.com/BurntSushi/memchr/actions) [![Crates.io](https://img.shields.io/crates/v/memchr.svg)](https://crates.io/crates/memchr) Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/). ### Documentation [https://docs.rs/memchr](https://docs.rs/memchr) ### Overview * The top-level module provides routines for searching for 1, 2 or 3 bytes in the forward or reverse direction. When searching for more than one byte, positions are considered a match if the byte at that position matches any of the bytes. * The `memmem` sub-module provides forward and reverse substring search routines. In all such cases, routines operate on `&[u8]` without regard to encoding. This is exactly what you want when searching either UTF-8 or arbitrary bytes. ### Compiling without the standard library memchr links to the standard library by default, but you can disable the `std` feature if you want to use it in a `#![no_std]` crate: ```toml [dependencies] memchr = { version = "2", default-features = false } ``` On `x86_64` platforms, when the `std` feature is disabled, the SSE2 accelerated implementations will be used. When `std` is enabled, AVX2 accelerated implementations will be used if the CPU is determined to support it at runtime. SIMD accelerated routines are also available on the `wasm32` and `aarch64` targets. The `std` feature is not required to use them. When a SIMD version is not available, then this crate falls back to [SWAR](https://en.wikipedia.org/wiki/SWAR) techniques. ### Minimum Rust version policy This crate's minimum supported `rustc` version is `1.61.0`. The current policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if `crate 1.0` requires Rust 1.20.0, then `crate 1.0.z` for all values of `z` will also require Rust 1.20.0 or newer. However, `crate 1.y` for `y > 0` may require a newer minimum version of Rust. In general, this crate will be conservative with respect to the minimum supported version of Rust. ### Testing strategy Given the complexity of the code in this crate, along with the pervasive use of `unsafe`, this crate has an extensive testing strategy. It combines multiple approaches: * Hand-written tests. * Exhaustive-style testing meant to exercise all possible branching and offset calculations. * Property based testing through [`quickcheck`](https://github.com/BurntSushi/quickcheck). * Fuzz testing through [`cargo fuzz`](https://github.com/rust-fuzz/cargo-fuzz). * A huge suite of benchmarks that are also run as tests. Benchmarks always confirm that the expected result occurs. Improvements to the testing infrastructure are very welcome. ### Algorithms used At time of writing, this crate's implementation of substring search actually has a few different algorithms to choose from depending on the situation. * For very small haystacks, [Rabin-Karp](https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm) is used to reduce latency. Rabin-Karp has very small overhead and can often complete before other searchers have even been constructed. * For small needles, a variant of the ["Generic SIMD"](http://0x80.pl/articles/simd-strfind.html#algorithm-1-generic-simd) algorithm is used. Instead of using the first and last bytes, a heuristic is used to select bytes based on a background distribution of byte frequencies. * In all other cases, [Two-Way](https://en.wikipedia.org/wiki/Two-way_string-matching_algorithm) is used. If possible, a prefilter based on the "Generic SIMD" algorithm linked above is used to find candidates quickly. A dynamic heuristic is used to detect if the prefilter is ineffective, and if so, disables it. ### Why is the standard library's substring search so much slower? We'll start by establishing what the difference in performance actually is. There are two relevant benchmark classes to consider: `prebuilt` and `oneshot`. The `prebuilt` benchmarks are designed to measure---to the extent possible---search time only. That is, the benchmark first starts by building a searcher and then only tracking the time for _using_ the searcher: ``` $ rebar rank benchmarks/record/x86_64/2023-08-26.csv --intersection -e memchr/memmem/prebuilt -e std/memmem/prebuilt Engine Version Geometric mean of speed ratios Benchmark count ------ ------- ------------------------------ --------------- rust/memchr/memmem/prebuilt 2.5.0 1.03 53 rust/std/memmem/prebuilt 1.73.0-nightly 180dffba1 6.50 53 ``` Conversely, the `oneshot` benchmark class measures the time it takes to both build the searcher _and_ use it: ``` $ rebar rank benchmarks/record/x86_64/2023-08-26.csv --intersection -e memchr/memmem/oneshot -e std/memmem/oneshot Engine Version Geometric mean of speed ratios Benchmark count ------ ------- ------------------------------ --------------- rust/memchr/memmem/oneshot 2.5.0 1.04 53 rust/std/memmem/oneshot 1.73.0-nightly 180dffba1 5.26 53 ``` **NOTE:** Replace `rebar rank` with `rebar cmp` in the above commands to explore the specific benchmarks and their differences. So in both cases, this crate is quite a bit faster over a broad sampling of benchmarks regardless of whether you measure only search time or search time plus construction time. The difference is a little smaller when you include construction time in your measurements. These two different types of benchmark classes make for a nice segue into one reason why the standard library's substring search can be slower: API design. In the standard library, the only APIs available to you require one to re-construct the searcher for every search. While you can benefit from building a searcher once and iterating over all matches in a single string, you cannot reuse that searcher to search other strings. This might come up when, for example, searching a file one line at a time. You'll need to re-build the searcher for every line searched, and this can [really matter][burntsushi-bstr-blog]. **NOTE:** The `prebuilt` benchmark for the standard library can't actually avoid measuring searcher construction at some level, because there is no API for it. Instead, the benchmark consists of building the searcher once and then finding all matches in a single string via an iterator. This tends to approximate a benchmark where searcher construction isn't measured, but it isn't perfect. While this means the comparison is not strictly apples-to-apples, it does reflect what is maximally possible with the standard library, and thus reflects the best that one could do in a real world scenario. While there is more to the story than just API design here, it's important to point out that even if the standard library's substring search were a precise clone of this crate internally, it would still be at a disadvantage in some workloads because of its API. (The same also applies to C's standard library `memmem` function. There is no way to amortize construction of the searcher. You need to pay for it on every call.) The other reason for the difference in performance is that the standard library has trouble using SIMD. In particular, substring search is implemented in the `core` library, where platform specific code generally can't exist. That's an issue because in order to utilize SIMD beyond SSE2 while maintaining portable binaries, one needs to use [dynamic CPU feature detection][dynamic-cpu], and that in turn requires platform specific code. While there is [an RFC for enabling target feature detection in `core`][core-feature], it doesn't yet exist. The bottom line here is that `core`'s substring search implementation is limited to making use of SSE2, but not AVX. Still though, this crate does accelerate substring search even when only SSE2 is available. The standard library could therefore adopt the techniques in this crate just for SSE2. The reason why that hasn't happened yet isn't totally clear to me. It likely needs a champion to push it through. The standard library tends to be more conservative in these things. With that said, the standard library does use some [SSE2 acceleration on `x86-64`][std-sse2] added in [this PR][std-sse2-pr]. However, at the time of writing, it is only used for short needles and doesn't use the frequency based heuristics found in this crate. **NOTE:** Another thing worth mentioning is that the standard library's substring search routine requires that both the needle and haystack have type `&str`. Unless you can assume that your data is valid UTF-8, building a `&str` will come with the overhead of UTF-8 validation. This may in turn result in overall slower searching depending on your workload. In contrast, the `memchr` crate permits both the needle and the haystack to have type `&[u8]`, where `&[u8]` can be created from a `&str` with zero cost. Therefore, the substring search in this crate is strictly more flexible than what the standard library provides. [burntsushi-bstr-blog]: https://blog.burntsushi.net/bstr/#motivation-based-on-performance [dynamic-cpu]: https://doc.rust-lang.org/std/arch/index.html#dynamic-cpu-feature-detection [core-feature]: https://github.com/rust-lang/rfcs/pull/3469 [std-sse2]: https://github.com/rust-lang/rust/blob/bf9229a2e366b4c311f059014a4aa08af16de5d8/library/core/src/str/pattern.rs#L1719-L1857 [std-sse2-pr]: https://github.com/rust-lang/rust/pull/103779 ## Files: rust/vendor/minimal-lexical/README.md minimal-lexical =============== This is a minimal version of [rust-lexical](https://github.com/Alexhuszagh/rust-lexical), meant to allow efficient round-trip float parsing. minimal-lexical implements a correct, fast float parser. Due to the small, stable nature of minimal-lexical, it is also well-adapted to private forks. If you do privately fork minimal-lexical, I recommend you contact me via [email](mailto:ahuszagh@gmail.com) or [Twitter](https://twitter.com/KardOnIce), so I can notify you of feature updates, bug fixes, or security vulnerabilities, as well as help you implement custom feature requests. I will not use your information for any other purpose, including, but not limited to disclosing your project or organization's use of minimal-lexical. minimal-lexical is designed for fast compile times and small binaries sizes, at the expense of a minor amount of performance. For improved performance, feel free to fork minimal-lexical with more aggressive inlining. **Similar Projects** For a high-level, all-in-one number conversion routines, see [rust-lexical](https://github.com/Alexhuszagh/rust-lexical). **Table Of Contents** - [Getting Started](#getting-started) - [Recipes](#recipes) - [Algorithms](#algorithms) - [Platform Support](platform-support) - [Minimum Version Support](minimum-version-support) - [Changelog](#changelog) - [License](#license) - [Contributing](#contributing) # Getting Started First, add the following to your `Cargo.toml`. ```toml [dependencies] minimal-lexical = "0.2" ``` Next, to parse a simple float, use the following: ```rust extern crate minimal_lexical; // Let's say we want to parse "1.2345". // First, we need an external parser to extract the integer digits ("1"), // the fraction digits ("2345"), and then parse the exponent to a 32-bit // integer (0). // Warning: // -------- // Please note that leading zeros must be trimmed from the integer, // and trailing zeros must be trimmed from the fraction. This cannot // be handled by minimal-lexical, since we accept iterators let integer = b"1"; let fraction = b"2345"; let float: f64 = minimal_lexical::parse_float(integer.iter(), fraction.iter(), 0); println!("float={:?}", float); // 1.235 ``` # Recipes You may be asking: where is the actual parser? Due to variation in float formats, and the goal of integrating utility for various data-interchange language parsers, such functionality would be beyond the scope of this library. For example, the following float is valid in Rust strings, but is invalid in JSON or TOML: ```json 1.e7 ``` Therefore, to use the library, you need functionality that extracts the significant digits to pass to `create_float`. Please see [simple-example](https://github.com/Alexhuszagh/minimal-lexical/blob/master/examples/simple.rs) for a simple, annotated example on how to use minimal-lexical as a parser. # Algorithms For an in-depth explanation on the algorithms minimal-lexical uses, please see [lexical-core#string-to-float](https://github.com/Alexhuszagh/rust-lexical/tree/master/lexical-core#string-to-float). # Platform Support minimal-lexical is tested on a wide variety of platforms, including big and small-endian systems, to ensure portable code. Supported architectures include: - x86_64 Linux, Windows, macOS, Android, iOS, FreeBSD, and NetBSD. - x86 Linux, macOS, Android, iOS, and FreeBSD. - aarch64 (ARM8v8-A) Linux, Android, and iOS. - armv7 (ARMv7-A) Linux, Android, and iOS. - arm (ARMv6) Linux, and Android. - mips (MIPS) Linux. - mipsel (MIPS LE) Linux. - mips64 (MIPS64 BE) Linux. - mips64el (MIPS64 LE) Linux. - powerpc (PowerPC) Linux. - powerpc64 (PPC64) Linux. - powerpc64le (PPC64LE) Linux. - s390x (IBM Z) Linux. minimal-lexical should also work on a wide variety of other architectures and ISAs. If you have any issue compiling minimal-lexical on any architecture, please file a bug report. # Minimum Version Support Minimal-lexical is tested to support Rustc 1.36+, including stable, beta, and nightly. Please report any errors compiling a supported lexical version on a compatible Rustc version. Please note we may increment the MSRV for compiler versions older than 18 months, to support at least the current Debian stable version, without breaking changes. # Changelog All changes are documented in [CHANGELOG](CHANGELOG). # License Minimal-lexical is dual licensed under the Apache 2.0 license as well as the MIT license. See the [LICENSE.md](LICENSE.md) file for full license details. # Contributing Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in minimal-lexical by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/nibble_vec/README.md NibbleVec ==== [![Build Status](https://travis-ci.org/michaelsproul/rust_nibble_vec.svg)](https://travis-ci.org/michaelsproul/rust_nibble_vec) Data-structure for storing a sequence of half-bytes. Wraps a `Vec`, providing safe and memory-efficient storage of 4-bit values. In terms of supported operations, the structure behaves kind of like a fixed length array, in that insertions into the middle of the vector are difficult (and unimplemented at present). ## Usage This code is available on the Rust package host: https://crates.io/crates/nibble_vec You can use it in your own projects by adding `nibble_vec` as a dependency in your `Cargo.toml`. ```toml [dependencies] nibble_vec = "0.0.5" ``` ## Documentation API documentation is available here: https://docs.rs/nibble_vec ## Contributors Made by: * Alexander Andreev ([@andreevlex](https://github.com/andreevlex)) * Devin Ragotzy ([@DevinR528](https://github.com/DevinR528)) * Michael Sproul ([@michaelsproul](https://github.com/michaelsproul)) * Vinzent Steinberg ([@vks](https://github.com/vks)) ## License MIT License. Copyright © Michael Sproul and contributors 2015-present. ## Files: rust/vendor/nix/README.md # Rust bindings to *nix APIs [![Cirrus Build Status](https://api.cirrus-ci.com/github/nix-rust/nix.svg)](https://cirrus-ci.com/github/nix-rust/nix) [![crates.io](https://img.shields.io/crates/v/nix.svg)](https://crates.io/crates/nix) [![maintenance-status](https://img.shields.io/badge/maintenance-looking--for--maintainer-orange.svg)](https://github.com/nix-rust/nix/issues/2132) [Documentation (Releases)](https://docs.rs/nix/) Nix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin, ...). The goal is to not provide a 100% unified interface, but to unify what can be while still providing platform specific APIs. For many system APIs, Nix provides a safe alternative to the unsafe APIs exposed by the [libc crate](https://github.com/rust-lang/libc). This is done by wrapping the libc functionality with types/abstractions that enforce legal/safe usage. As an example of what Nix provides, examine the differences between what is exposed by libc and nix for the [gethostname](https://man7.org/linux/man-pages/man2/gethostname.2.html) system call: ```rust,ignore // libc api (unsafe, requires handling return code/errno) pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int; // nix api (returns a nix::Result) pub fn gethostname() -> Result; ``` ## Supported Platforms nix target support consists of three tiers. While nix attempts to support all platforms supported by [libc](https://github.com/rust-lang/libc), only some platforms are actively supported due to either technical or manpower limitations. Support for platforms is split into three tiers: * Tier 1 - Builds and tests for this target are run in CI. Failures of either block the inclusion of new code. * Tier 2 - Builds for this target are run in CI. Failures during the build blocks the inclusion of new code. Tests may be run, but failures in tests don't block the inclusion of new code. * Tier 3 - Builds for this target are run in CI. Failures during the build *do not* necessarily block the inclusion of new code. That is, at our discretion a Tier 3 target may be dropped at any time, if it would otherwise block development. Platforms not listed are supported on a best-effort basis, relying on our users to report any problems. The following targets are supported by `nix`:
Tier 1 Tier 2 Tier 3
  • aarch64-apple-darwin
  • aarch64-unknown-linux-gnu
  • arm-unknown-linux-gnueabi
  • armv7-unknown-linux-gnueabihf
  • i686-unknown-freebsd
  • i686-unknown-linux-gnu
  • i686-unknown-linux-musl
  • mips-unknown-linux-gnu
  • mips64-unknown-linux-gnuabi64
  • mips64el-unknown-linux-gnuabi64
  • mipsel-unknown-linux-gnu
  • powerpc64le-unknown-linux-gnu
  • x86_64-unknown-freebsd
  • x86_64-unknown-linux-gnu
  • x86_64-unknown-linux-musl
  • aarch64-apple-ios
  • aarch64-linux-android
  • arm-linux-androideabi
  • arm-unknown-linux-musleabi
  • armv7-linux-androideabi
  • i686-linux-android
  • s390x-unknown-linux-gnu
  • x86_64-linux-android
  • x86_64-unknown-illumos
  • x86_64-unknown-netbsd
  • armv7-unknown-linux-uclibceabihf
  • powerpc64-unknown-linux-gnu
  • x86_64-fuchsia
  • x86_64-unknown-dragonfly
  • x86_64-unknown-haiku
  • x86_64-unknown-linux-gnux32
  • x86_64-unknown-openbsd
  • x86_64-unknown-redox
  • i686-unknown-hurd-gnu
  • ## Minimum Supported Rust Version (MSRV) nix is supported on Rust 1.69 and higher. Its MSRV will not be changed in the future without bumping the major or minor version. ## Contributing Contributions are very welcome. Please See [CONTRIBUTING](CONTRIBUTING.md) for additional details. Feel free to join us in [the nix-rust/nix](https://gitter.im/nix-rust/nix) channel on Gitter to discuss `nix` development. ## License Nix is licensed under the MIT license. See [LICENSE](LICENSE) for more details. ## Files: rust/vendor/nom/README.md # nom, eating data byte by byte [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Join the chat at https://gitter.im/Geal/nom](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Geal/nom?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://github.com/Geal/nom/actions/workflows/ci.yml/badge.svg)](https://github.com/Geal/nom/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/Geal/nom/badge.svg?branch=main)](https://coveralls.io/github/Geal/nom?branch=main) [![Crates.io Version](https://img.shields.io/crates/v/nom.svg)](https://crates.io/crates/nom) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.48.0+-lightgray.svg)](#rust-version-requirements-msrv) nom is a parser combinators library written in Rust. Its goal is to provide tools to build safe parsers without compromising the speed or memory consumption. To that end, it uses extensively Rust's *strong typing* and *memory safety* to produce fast and correct parsers, and provides functions, macros and traits to abstract most of the error prone plumbing. ![nom logo in CC0 license, by Ange Albertini](https://raw.githubusercontent.com/Geal/nom/main/assets/nom.png) *nom will happily take a byte out of your files :)* - [Example](#example) - [Documentation](#documentation) - [Why use nom?](#why-use-nom) - [Binary format parsers](#binary-format-parsers) - [Text format parsers](#text-format-parsers) - [Programming language parsers](#programming-language-parsers) - [Streaming formats](#streaming-formats) - [Parser combinators](#parser-combinators) - [Technical features](#technical-features) - [Rust version requirements](#rust-version-requirements-msrv) - [Installation](#installation) - [Related projects](#related-projects) - [Parsers written with nom](#parsers-written-with-nom) - [Contributors](#contributors) ## Example [Hexadecimal color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) parser: ```rust extern crate nom; use nom::{ IResult, bytes::complete::{tag, take_while_m_n}, combinator::map_res, sequence::tuple }; #[derive(Debug,PartialEq)] pub struct Color { pub red: u8, pub green: u8, pub blue: u8, } fn from_hex(input: &str) -> Result { u8::from_str_radix(input, 16) } fn is_hex_digit(c: char) -> bool { c.is_digit(16) } fn hex_primary(input: &str) -> IResult<&str, u8> { map_res( take_while_m_n(2, 2, is_hex_digit), from_hex )(input) } fn hex_color(input: &str) -> IResult<&str, Color> { let (input, _) = tag("#")(input)?; let (input, (red, green, blue)) = tuple((hex_primary, hex_primary, hex_primary))(input)?; Ok((input, Color { red, green, blue })) } fn main() {} #[test] fn parse_color() { assert_eq!(hex_color("#2F14DF"), Ok(("", Color { red: 47, green: 20, blue: 223, }))); } ``` ## Documentation - [Reference documentation](https://docs.rs/nom) - [Various design documents and tutorials](https://github.com/Geal/nom/tree/main/doc) - [List of combinators and their behaviour](https://github.com/Geal/nom/blob/main/doc/choosing_a_combinator.md) If you need any help developing your parsers, please ping `geal` on IRC (libera, geeknode, oftc), go to `#nom-parsers` on Libera IRC, or on the [Gitter chat room](https://gitter.im/Geal/nom). ## Why use nom If you want to write: ### Binary format parsers nom was designed to properly parse binary formats from the beginning. Compared to the usual handwritten C parsers, nom parsers are just as fast, free from buffer overflow vulnerabilities, and handle common patterns for you: - [TLV](https://en.wikipedia.org/wiki/Type-length-value) - Bit level parsing - Hexadecimal viewer in the debugging macros for easy data analysis - Streaming parsers for network formats and huge files Example projects: - [FLV parser](https://github.com/rust-av/flavors) - [Matroska parser](https://github.com/rust-av/matroska) - [tar parser](https://github.com/Keruspe/tar-parser.rs) ### Text format parsers While nom was made for binary format at first, it soon grew to work just as well with text formats. From line based formats like CSV, to more complex, nested formats such as JSON, nom can manage it, and provides you with useful tools: - Fast case insensitive comparison - Recognizers for escaped strings - Regular expressions can be embedded in nom parsers to represent complex character patterns succinctly - Special care has been given to managing non ASCII characters properly Example projects: - [HTTP proxy](https://github.com/sozu-proxy/sozu/tree/main/lib/src/protocol/http/parser) - [TOML parser](https://github.com/joelself/tomllib) ### Programming language parsers While programming language parsers are usually written manually for more flexibility and performance, nom can be (and has been successfully) used as a prototyping parser for a language. nom will get you started quickly with powerful custom error types, that you can leverage with [nom_locate](https://github.com/fflorent/nom_locate) to pinpoint the exact line and column of the error. No need for separate tokenizing, lexing and parsing phases: nom can automatically handle whitespace parsing, and construct an AST in place. Example projects: - [PHP VM](https://github.com/tagua-vm/parser) - eve language prototype - [xshade shading language](https://github.com/xshade-lang/xshade/) ### Streaming formats While a lot of formats (and the code handling them) assume that they can fit the complete data in memory, there are formats for which we only get a part of the data at once, like network formats, or huge files. nom has been designed for a correct behaviour with partial data: If there is not enough data to decide, nom will tell you it needs more instead of silently returning a wrong result. Whether your data comes entirely or in chunks, the result should be the same. It allows you to build powerful, deterministic state machines for your protocols. Example projects: - [HTTP proxy](https://github.com/sozu-proxy/sozu/tree/main/lib/src/protocol/http/parser) - [Using nom with generators](https://github.com/Geal/generator_nom) ## Parser combinators Parser combinators are an approach to parsers that is very different from software like [lex](https://en.wikipedia.org/wiki/Lex_(software)) and [yacc](https://en.wikipedia.org/wiki/Yacc). Instead of writing the grammar in a separate file and generating the corresponding code, you use very small functions with very specific purpose, like "take 5 bytes", or "recognize the word 'HTTP'", and assemble them in meaningful patterns like "recognize 'HTTP', then a space, then a version". The resulting code is small, and looks like the grammar you would have written with other parser approaches. This has a few advantages: - The parsers are small and easy to write - The parsers components are easy to reuse (if they're general enough, please add them to nom!) - The parsers components are easy to test separately (unit tests and property-based tests) - The parser combination code looks close to the grammar you would have written - You can build partial parsers, specific to the data you need at the moment, and ignore the rest ## Technical features nom parsers are for: - [x] **byte-oriented**: The basic type is `&[u8]` and parsers will work as much as possible on byte array slices (but are not limited to them) - [x] **bit-oriented**: nom can address a byte slice as a bit stream - [x] **string-oriented**: The same kind of combinators can apply on UTF-8 strings as well - [x] **zero-copy**: If a parser returns a subset of its input data, it will return a slice of that input, without copying - [x] **streaming**: nom can work on partial data and detect when it needs more data to produce a correct result - [x] **descriptive errors**: The parsers can aggregate a list of error codes with pointers to the incriminated input slice. Those error lists can be pattern matched to provide useful messages. - [x] **custom error types**: You can provide a specific type to improve errors returned by parsers - [x] **safe parsing**: nom leverages Rust's safe memory handling and powerful types, and parsers are routinely fuzzed and tested with real world data. So far, the only flaws found by fuzzing were in code written outside of nom - [x] **speed**: Benchmarks have shown that nom parsers often outperform many parser combinators library like Parsec and attoparsec, some regular expression engines and even handwritten C parsers Some benchmarks are available on [Github](https://github.com/Geal/nom_benchmarks). ## Rust version requirements (MSRV) The 7.0 series of nom supports **Rustc version 1.48 or greater**. It is known to work properly on Rust 1.41.1 but there is no guarantee it will stay the case through this major release. The current policy is that this will only be updated in the next major nom release. ## Installation nom is available on [crates.io](https://crates.io/crates/nom) and can be included in your Cargo enabled project like this: ```toml [dependencies] nom = "7" ``` There are a few compilation features: * `alloc`: (activated by default) if disabled, nom can work in `no_std` builds without memory allocators. If enabled, combinators that allocate (like `many0`) will be available * `std`: (activated by default, activates `alloc` too) if disabled, nom can work in `no_std` builds You can configure those features like this: ```toml [dependencies.nom] version = "7" default-features = false features = ["alloc"] ``` # Related projects - [Get line and column info in nom's input type](https://github.com/fflorent/nom_locate) - [Using nom as lexer and parser](https://github.com/Rydgel/monkey-rust) # Parsers written with nom Here is a (non exhaustive) list of known projects using nom: - Text file formats: [Ceph Crush](https://github.com/cholcombe973/crushtool), [Cronenberg](https://github.com/ayrat555/cronenberg), [XFS Runtime Stats](https://github.com/ChrisMacNaughton/xfs-rs), [CSV](https://github.com/GuillaumeGomez/csv-parser), [FASTA](https://github.com/TianyiShi2001/nom-fasta), [FASTQ](https://github.com/elij/fastq.rs), [INI](https://github.com/Geal/nom/blob/main/tests/ini.rs), [ISO 8601 dates](https://github.com/badboy/iso8601), [libconfig-like configuration file format](https://github.com/filipegoncalves/rust-config), [Web archive](https://github.com/sbeckeriv/warc_nom_parser), [PDB](https://github.com/TianyiShi2001/nom-pdb), [proto files](https://github.com/tafia/protobuf-parser), [Fountain screenplay markup](https://github.com/adamchalmers/fountain-rs), [vimwiki](https://github.com/chipsenkbeil/vimwiki-server/tree/master/vimwiki) & [vimwiki_macros](https://github.com/chipsenkbeil/vimwiki-server/tree/master/vimwiki_macros) - Programming languages: [PHP](https://github.com/tagua-vm/parser), [Basic Calculator](https://github.com/balajisivaraman/basic_calculator_rs), [GLSL](https://github.com/phaazon/glsl), [Lua](https://github.com/doomrobo/nom-lua53), [Python](https://github.com/ProgVal/rust-python-parser), [SQL](https://github.com/ms705/nom-sql), [Elm](https://github.com/cout970/Elm-interpreter), [SystemVerilog](https://github.com/dalance/sv-parser), [Turtle](https://github.com/vandenoever/rome/tree/master/src/io/turtle), [CSML](https://github.com/CSML-by-Clevy/csml-interpreter), [Wasm](https://github.com/Strytyp/wasm-nom), [Pseudocode](https://github.com/Gungy2/pseudocode) [Filter for MeiliSearch](https://github.com/meilisearch/meilisearch) - Interface definition formats: [Thrift](https://github.com/thehydroimpulse/thrust) - Audio, video and image formats: [GIF](https://github.com/Geal/gif.rs), [MagicaVoxel .vox](https://github.com/davidedmonds/dot_vox), [midi](https://github.com/derekdreery/nom-midi-rs), [SWF](https://github.com/open-flash/swf-parser), [WAVE](http://github.com/noise-Labs/wave), [Matroska (MKV)](https://github.com/rust-av/matroska) - Document formats: [TAR](https://github.com/Keruspe/tar-parser.rs), [GZ](https://github.com/nharward/nom-gzip), [GDSII](https://github.com/erihsu/gds2-io) - Cryptographic formats: [X.509](https://github.com/rusticata/x509-parser) - Network protocol formats: [Bencode](https://github.com/jbaum98/bencode.rs), [D-Bus](https://github.com/toshokan/misato), [DHCP](https://github.com/rusticata/dhcp-parser), [HTTP](https://github.com/sozu-proxy/sozu/tree/main/lib/src/protocol/http), [URI](https://github.com/santifa/rrp/blob/master/src/uri.rs), [IMAP](https://github.com/djc/tokio-imap), [IRC](https://github.com/Detegr/RBot-parser), [Pcap-NG](https://github.com/richo/pcapng-rs), [Pcap](https://github.com/ithinuel/pcap-rs), [Pcap + PcapNG](https://github.com/rusticata/pcap-parser), [IKEv2](https://github.com/rusticata/ipsec-parser), [NTP](https://github.com/rusticata/ntp-parser), [SNMP](https://github.com/rusticata/snmp-parser), [Kerberos v5](https://github.com/rusticata/kerberos-parser), [DER](https://github.com/rusticata/der-parser), [TLS](https://github.com/rusticata/tls-parser), [IPFIX / Netflow v10](https://github.com/dominotree/rs-ipfix), [GTP](https://github.com/fuerstenau/gorrosion-gtp), [SIP](https://github.com/armatusmiles/sipcore/tree/master/crates/sipmsg), [Prometheus](https://github.com/timberio/vector/blob/master/lib/prometheus-parser/src/line.rs) - Language specifications: [BNF](https://github.com/snewt/bnf) - Misc formats: [Gameboy ROM](https://github.com/MarkMcCaskey/gameboy-rom-parser), [ANT FIT](https://github.com/stadelmanma/fitparse-rs), [Version Numbers](https://github.com/fosskers/rs-versions), [Telcordia/Bellcore SR-4731 SOR OTDR files](https://github.com/JamesHarrison/otdrs), [MySQL binary log](https://github.com/PrivateRookie/boxercrab), [URI](https://github.com/Skasselbard/nom-uri), [Furigana](https://github.com/sachaarbonel/furigana.rs), [Wordle Result](https://github.com/Fyko/wordle-stats/tree/main/parser) Want to create a new parser using `nom`? A list of not yet implemented formats is available [here](https://github.com/Geal/nom/issues/14). Want to add your parser here? Create a pull request for it! # Contributors nom is the fruit of the work of many contributors over the years, many thanks for your help! ## Files: rust/vendor/nom-derive-impl/README.md rust/vendor/nom-derive/README.md # nom-derive [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![docs.rs](https://docs.rs/nom-derive/badge.svg)](https://docs.rs/nom-derive) [![Build Status](https://travis-ci.org/chifflier/nom-derive.svg?branch=master)](https://travis-ci.org/chifflier/nom-derive) [![Crates.io Version](https://img.shields.io/crates/v/nom-derive.svg)](https://crates.io/crates/nom-derive) ## Overview nom-derive is a custom derive attribute, to derive [nom] parsers automatically from the structure definition. It is not meant to replace [nom], but to provide a quick and easy way to generate parsers for structures, especially for simple structures. This crate aims at simplifying common cases. In some cases, writing the parser manually will remain more efficient. - [API documentation](https://docs.rs/nom-derive) - The [docs::Nom] pseudo-module. This is the main documentation for the `Nom` attribute, with all possible options and many examples. *Feedback welcome !* ## `#[derive(Nom)]` This crate exposes a single custom-derive macro `Nom` which implements `parse` for the struct it is applied to. The goal of this project is that: * `derive(Nom)` should be enough for you to derive [nom] parsers for simple structures easily, without having to write it manually * it allows overriding any parsing method by your own * it allows using generated parsing functions along with handwritten parsers and combining them without efforts * it remains as fast as nom `nom-derive` adds declarative parsing to `nom`. It also allows mixing with procedural parsing easily, making writing parsers for byte-encoded formats very easy. For example: ```rust use nom_derive::*; #[derive(Nom)] struct S { a: u32, b: u16, c: u16 } ``` This adds static method `parse` to `S`. The generated code looks like: ```rust,ignore impl S { pub fn parse(i: &[u8]) -> nom::IResult(&[u8], S) { let (i, a) = be_u32(i)?; let (i, b) = be_u16(i)?; let (i, c) = be_u16(i)?; Ok((i, S{ a, b, c })) } } ``` To parse input, just call `let res = S::parse(input);`. For extensive documentation of all attributes and examples, see the documentation of [docs::Nom] custom derive attribute. Many examples are provided, and more can be found in the [project tests](https://github.com/rust-bakery/nom-derive/tree/master/tests). ## Combinators visibility All inferred parsers will generate code with absolute type path, so there is no need to add `use` statements for them. However, if you use any combinator directly (or in a `Parse` statement, for ex.), it has to be imported as usual. That is probably not going to change, since * a proc_macro cannot export items other than functions tagged with `#[proc_macro_derive]` * there are variants of combinators with the same names (complete/streaming, bits/bytes), so re-exporting them would create side-effects. ## Debug tips * If the generated parser does not compile, add `#[nom(DebugDerive)]` to the structure. It will dump the generated parser to `stderr`. * If the generated parser fails at runtime, try adding `#[nom(Debug)]` to the structure or to fields. It wraps subparsers in `dbg_dmp` and will print the field name and input to `stderr` if the parser fails. [nom]: https://github.com/geal/nom ## Changes See `CHANGELOG.md`, and `UPGRADING.md` for instructions for upgrading major versions. ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/ntp-parser/README.md # ntp-parser [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![Build Status](https://travis-ci.org/rusticata/ntp-parser.svg?branch=master)](https://travis-ci.org/rusticata/ntp-parser) [![Crates.io Version](https://img.shields.io/crates/v/ntp-parser.svg)](https://crates.io/crates/ntp-parser) ## Overview ntp-parser is a parser for the NTP protocol. This crate mostly serves as a demo/example crate for network protocol parsers written using nom, and nom-derive. ## Changes ### 0.6.0 - Upgrade to nom 7 ### 0.5.0 - Upgrade to nom 6 - Convert all macro-based parsers to functions - Convert to nom-derive - Add support for NTP version 3, update function names to match version ### 0.4.0 - Set edition to 2018 - Upgrade to nom 5 ### 0.3.0 - Upgrade to nom 4 ### 0.2.1 - Fix parsing of extensions ### 0.2.0 - Use newtype for NtpMode, remove enum_primitive - Switch license to MIT + APLv2 ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/num-bigint/README.md # num-bigint [![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint) [![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint) [![minimum rustc 1.60](https://img.shields.io/badge/rustc-1.60+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![build status](https://github.com/rust-num/num-bigint/workflows/master/badge.svg)](https://github.com/rust-num/num-bigint/actions) Big integer types for Rust, `BigInt` and `BigUint`. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] num-bigint = "0.4" ``` ## Features The `std` crate feature is enabled by default, and is mandatory before Rust 1.36 and the stabilized `alloc` crate. If you depend on `num-bigint` with `default-features = false`, you must manually enable the `std` feature yourself if your compiler is not new enough. ### Random Generation `num-bigint` supports the generation of random big integers when the `rand` feature is enabled. To enable it include rand as ```toml rand = "0.8" num-bigint = { version = "0.4", features = ["rand"] } ``` Note that you must use the version of `rand` that `num-bigint` is compatible with: `0.8`. ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-bigint` crate is tested for rustc 1.60 and greater. ## Alternatives While `num-bigint` strives for good performance in pure Rust code, other crates may offer better performance with different trade-offs. The following table offers a brief comparison to a few alternatives. | Crate | License | Min rustc | Implementation | Features | | :--------------- | :------------- | :-------- | :------------- | :------- | | **`num-bigint`** | MIT/Apache-2.0 | 1.60 | pure rust | dynamic width, number theoretical functions | | [`awint`] | MIT/Apache-2.0 | 1.66 | pure rust | fixed width, heap or stack, concatenation macros | | [`bnum`] | MIT/Apache-2.0 | 1.65 | pure rust | fixed width, parity with Rust primitives including floats | | [`crypto-bigint`] | MIT/Apache-2.0 | 1.73 | pure rust | fixed width, stack only | | [`ibig`] | MIT/Apache-2.0 | 1.49 | pure rust | dynamic width, number theoretical functions | | [`rug`] | LGPL-3.0+ | 1.65 | bundles [GMP] via [`gmp-mpfr-sys`] | all the features of GMP, MPFR, and MPC | [`awint`]: https://crates.io/crates/awint [`bnum`]: https://crates.io/crates/bnum [`crypto-bigint`]: https://crates.io/crates/crypto-bigint [`ibig`]: https://crates.io/crates/ibig [`rug`]: https://crates.io/crates/rug [GMP]: https://gmplib.org/ [`gmp-mpfr-sys`]: https://crates.io/crates/gmp-mpfr-sys ## License Licensed under either of * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/num-bigint-0.2.6/README.md # num-bigint [![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint) [![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint) ![minimum rustc 1.15](https://img.shields.io/badge/rustc-1.15+-red.svg) [![Travis status](https://travis-ci.org/rust-num/num-bigint.svg?branch=master)](https://travis-ci.org/rust-num/num-bigint) Big integer types for Rust, `BigInt` and `BigUint`. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] num-bigint = "0.2" ``` and this to your crate root: ```rust extern crate num_bigint; ``` ## Features The `std` crate feature is mandatory and enabled by default. If you depend on `num-bigint` with `default-features = false`, you must manually enable the `std` feature yourself. In the future, we hope to support `#![no_std]` with the `alloc` crate when `std` is not enabled. Implementations for `i128` and `u128` are only available with Rust 1.26 and later. The build script automatically detects this, but you can make it mandatory by enabling the `i128` crate feature. ### Random Generation `num-bigint` supports the generation of random big integers when the `rand` feature is enabled. To enable it include rand as ```toml rand = "0.5" num-bigint = { version = "0.2", features = ["rand"] } ``` Note that you must use the version of `rand` that `num-bigint` is compatible with: `0.5`. ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-bigint` crate is tested for rustc 1.15 and greater. ## Alternatives While `num-bigint` strives for good performance in pure Rust code, other crates may offer better performance with different trade-offs. The following table offers a brief comparison to a few alternatives. | Crate | License | Min rustc | Implementation | | :--------------- | :------------- | :-------- | :------------- | | **`num-bigint`** | MIT/Apache-2.0 | 1.15 | pure rust | | [`ramp`] | Apache-2.0 | nightly | rust and inline assembly | | [`rug`] | LGPL-3.0+ | 1.31 | bundles [GMP] via [`gmp-mpfr-sys`] | | [`rust-gmp`] | MIT | stable? | links to [GMP] | | [`apint`] | MIT/Apache-2.0 | 1.26 | pure rust (unfinished) | [GMP]: https://gmplib.org/ [`gmp-mpfr-sys`]: https://crates.io/crates/gmp-mpfr-sys [`rug`]: https://crates.io/crates/rug [`rust-gmp`]: https://crates.io/crates/rust-gmp [`ramp`]: https://crates.io/crates/ramp [`apint`]: https://crates.io/crates/apint ## Files: rust/vendor/num-derive/README.md # num-derive [![crate](https://img.shields.io/crates/v/num-derive.svg)](https://crates.io/crates/num-derive) [![documentation](https://docs.rs/num-derive/badge.svg)](https://docs.rs/num-derive) [![minimum rustc 1.56](https://img.shields.io/badge/rustc-1.56+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![build status](https://github.com/rust-num/num-derive/workflows/master/badge.svg)](https://github.com/rust-num/num-derive/actions) Procedural macros to derive numeric traits in Rust. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] num-traits = "0.2" num-derive = "0.4" ``` and this to your crate root: ```rust #[macro_use] extern crate num_derive; ``` Then you can derive traits on your own types: ```rust #[derive(FromPrimitive, ToPrimitive)] enum Color { Red, Blue, Green, } ``` ## Optional features - **`full-syntax`** — Enables `num-derive` to handle enum discriminants represented by complex expressions. Usually can be avoided by [utilizing constants], so only use this feature if namespace pollution is undesired and [compile time doubling] is acceptable. [utilizing constants]: https://github.com/rust-num/num-derive/pull/3#issuecomment-359044704 [compile time doubling]: https://github.com/rust-num/num-derive/pull/3#issuecomment-359172588 ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-derive` crate is tested for rustc 1.56 and greater. ## License Licensed under either of * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/num-integer/README.md # num-integer [![crate](https://img.shields.io/crates/v/num-integer.svg)](https://crates.io/crates/num-integer) [![documentation](https://docs.rs/num-integer/badge.svg)](https://docs.rs/num-integer) [![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![build status](https://github.com/rust-num/num-integer/workflows/master/badge.svg)](https://github.com/rust-num/num-integer/actions) `Integer` trait and functions for Rust. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] num-integer = "0.1" ``` ## Features This crate can be used without the standard library (`#![no_std]`) by disabling the default `std` feature. Use this in `Cargo.toml`: ```toml [dependencies.num-integer] version = "0.1.36" default-features = false ``` There is no functional difference with and without `std` at this time, but there may be in the future. ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-integer` crate is tested for rustc 1.31 and greater. ## License Licensed under either of * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/num-iter/README.md # num-iter [![crate](https://img.shields.io/crates/v/num-iter.svg)](https://crates.io/crates/num-iter) [![documentation](https://docs.rs/num-iter/badge.svg)](https://docs.rs/num-iter) [![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![build status](https://github.com/rust-num/num-iter/workflows/master/badge.svg)](https://github.com/rust-num/num-iter/actions) Generic `Range` iterators for Rust. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] num-iter = "0.1" ``` ## Features This crate can be used without the standard library (`#![no_std]`) by disabling the default `std` feature. Use this in `Cargo.toml`: ```toml [dependencies.num-iter] version = "0.1.35" default-features = false ``` There is no functional difference with and without `std` at this time, but there may be in the future. ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-iter` crate is tested for rustc 1.31 and greater. ## License Licensed under either of * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/num-traits/README.md # num-traits [![crate](https://img.shields.io/crates/v/num-traits.svg)](https://crates.io/crates/num-traits) [![documentation](https://docs.rs/num-traits/badge.svg)](https://docs.rs/num-traits) [![minimum rustc 1.60](https://img.shields.io/badge/rustc-1.60+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![build status](https://github.com/rust-num/num-traits/workflows/master/badge.svg)](https://github.com/rust-num/num-traits/actions) Numeric traits for generic mathematics in Rust. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] num-traits = "0.2" ``` ## Features This crate can be used without the standard library (`#![no_std]`) by disabling the default `std` feature. Use this in `Cargo.toml`: ```toml [dependencies.num-traits] version = "0.2" default-features = false # features = ["libm"] # <--- Uncomment if you wish to use `Float` and `Real` without `std` ``` The `Float` and `Real` traits are only available when either `std` or `libm` is enabled. The `FloatCore` trait is always available. `MulAdd` and `MulAddAssign` for `f32` and `f64` also require `std` or `libm`, as do implementations of signed and floating- point exponents in `Pow`. ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-traits` crate is tested for rustc 1.60 and greater. ## License Licensed under either of * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/num_enum/README.md rust/vendor/num_enum_derive/README.md num_enum ======== Procedural macros to make inter-operation between primitives and enums easier. This crate is no_std compatible. [![crates.io](https://img.shields.io/crates/v/num_enum.svg)](https://crates.io/crates/num_enum) [![Documentation](https://docs.rs/num_enum/badge.svg)](https://docs.rs/num_enum) [![Build Status](https://travis-ci.org/illicitonion/num_enum.svg?branch=master)](https://travis-ci.org/illicitonion/num_enum) Turning an enum into a primitive -------------------------------- ```rust use num_enum::IntoPrimitive; #[derive(IntoPrimitive)] #[repr(u8)] enum Number { Zero, One, } fn main() { let zero: u8 = Number::Zero.into(); assert_eq!(zero, 0u8); } ``` `num_enum`'s `IntoPrimitive` is more type-safe than using `as`, because `as` will silently truncate - `num_enum` only derives `From` for exactly the discriminant type of the enum. Attempting to turn a primitive into an enum with try_from ---------------------------------------------- ```rust use num_enum::TryFromPrimitive; use std::convert::TryFrom; #[derive(Debug, Eq, PartialEq, TryFromPrimitive)] #[repr(u8)] enum Number { Zero, One, } fn main() { let zero = Number::try_from(0u8); assert_eq!(zero, Ok(Number::Zero)); let three = Number::try_from(3u8); assert_eq!( three.unwrap_err().to_string(), "No discriminant in enum `Number` matches the value `3`", ); } ``` Variant alternatives --------------- Sometimes a single enum variant might be representable by multiple numeric values. The `#[num_enum(alternatives = [..])]` attribute allows you to define additional value alternatives for individual variants. (The behavior of `IntoPrimitive` is unaffected by this attribute, it will always return the canonical value.) ```rust use num_enum::TryFromPrimitive; use std::convert::TryFrom; #[derive(Debug, Eq, PartialEq, TryFromPrimitive)] #[repr(u8)] enum Number { Zero = 0, #[num_enum(alternatives = [2])] OneOrTwo = 1, } fn main() { let zero = Number::try_from(0u8); assert_eq!(zero, Ok(Number::Zero)); let one = Number::try_from(1u8); assert_eq!(one, Ok(Number::OneOrTwo)); let two = Number::try_from(2u8); assert_eq!(two, Ok(Number::OneOrTwo)); let three = Number::try_from(3u8); assert_eq!( three.unwrap_err().to_string(), "No discriminant in enum `Number` matches the value `3`", ); } ``` Range expressions are also supported for alternatives, but this requires enabling the `complex-expressions` feature: ```rust use num_enum::TryFromPrimitive; use std::convert::TryFrom; #[derive(Debug, Eq, PartialEq, TryFromPrimitive)] #[repr(u8)] enum Number { Zero = 0, #[num_enum(alternatives = [2..16])] Some = 1, #[num_enum(alternatives = [17, 18..=255])] Many = 16, } fn main() { let zero = Number::try_from(0u8); assert_eq!(zero, Ok(Number::Zero)); let some = Number::try_from(15u8); assert_eq!(some, Ok(Number::Some)); let many = Number::try_from(255u8); assert_eq!(many, Ok(Number::Many)); } ``` Default variant --------------- Sometimes it is desirable to have an `Other` variant in an enum that acts as a kind of a wildcard matching all the value not yet covered by other variants. The `#[num_enum(default)]` attribute allows you to mark variant as the default. (The behavior of `IntoPrimitive` is unaffected by this attribute, it will always return the canonical value.) ```rust use num_enum::TryFromPrimitive; use std::convert::TryFrom; #[derive(Debug, Eq, PartialEq, TryFromPrimitive)] #[repr(u8)] enum Number { Zero = 0, #[num_enum(default)] NonZero = 1, } fn main() { let zero = Number::try_from(0u8); assert_eq!(zero, Ok(Number::Zero)); let one = Number::try_from(1u8); assert_eq!(one, Ok(Number::NonZero)); let two = Number::try_from(2u8); assert_eq!(two, Ok(Number::NonZero)); } ``` Safely turning a primitive into an exhaustive enum with from_primitive ------------------------------------------------------------- If your enum has all possible primitive values covered, you can derive `FromPrimitive` for it (which auto-implement stdlib's `From`): You can cover all possible values by: * Having variants for every possible value * Having a variant marked `#[num_enum(default)]` * Having a variant marked `#[num_enum(catch_all)]` * Having `#[num_enum(alternatives = [...])`s covering values not covered by a variant. ```rust use num_enum::FromPrimitive; #[derive(Debug, Eq, PartialEq, FromPrimitive)] #[repr(u8)] enum Number { Zero, #[num_enum(default)] NonZero, } fn main() { assert_eq!( Number::Zero, Number::from(0_u8), ); assert_eq!( Number::NonZero, Number::from(1_u8), ); } ``` Catch-all variant ----------------- Sometimes it is desirable to have an `Other` variant which holds the otherwise un-matched value as a field. The `#[num_enum(catch_all)]` attribute allows you to mark at most one variant for this purpose. The variant it's applied to must be a tuple variant with exactly one field matching the `repr` type. ```rust use num_enum::FromPrimitive; use std::convert::TryFrom; #[derive(Debug, Eq, PartialEq, FromPrimitive)] #[repr(u8)] enum Number { Zero = 0, #[num_enum(catch_all)] NonZero(u8), } fn main() { let zero = Number::from(0u8); assert_eq!(zero, Number::Zero); let one = Number::from(1u8); assert_eq!(one, Number::NonZero(1_u8)); let two = Number::from(2u8); assert_eq!(two, Number::NonZero(2_u8)); } ``` As this is naturally exhaustive, this is only supported for `FromPrimitive`, not also `TryFromPrimitive`. Unsafely turning a primitive into an enum with from_unchecked ------------------------------------------------------------- If you're really certain a conversion will succeed (and have not made use of `#[num_enum(default)]` or `#[num_enum(alternatives = [..])]` for any of its variants), and want to avoid a small amount of overhead, you can use unsafe code to do this conversion. Unless you have data showing that the match statement generated in the `try_from` above is a bottleneck for you, you should avoid doing this, as the unsafe code has potential to cause serious memory issues in your program. ```rust use num_enum::UnsafeFromPrimitive; #[derive(Debug, Eq, PartialEq, UnsafeFromPrimitive)] #[repr(u8)] enum Number { Zero, One, } fn main() { assert_eq!( unsafe { Number::from_unchecked(0_u8) }, Number::Zero, ); assert_eq!( unsafe { Number::from_unchecked(1_u8) }, Number::One, ); } unsafe fn undefined_behavior() { let _ = Number::from_unchecked(2); // 2 is not a valid discriminant! } ``` Optional features ----------------- Some enum values may be composed of complex expressions, for example: ```rust enum Number { Zero = (0, 1).0, One = (0, 1).1, } ``` To cut down on compile time, these are not supported by default, but if you enable the `complex-expressions` feature of your dependency on `num_enum`, these should start working. License ------- num_enum may be used under your choice of the BSD 3-clause, Apache 2, or MIT license. ## Files: rust/vendor/oid-registry/README.md [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![docs.rs](https://docs.rs/oid-registry/badge.svg)](https://docs.rs/oid-registry) [![crates.io](https://img.shields.io/crates/v/oid-registry.svg)](https://crates.io/crates/oid-registry) [![Github CI](https://github.com/rusticata/oid-registry/workflows/Continuous%20integration/badge.svg)](https://github.com/rusticata/oid-registry/actions) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.63.0+-lightgray.svg)](#rust-version-requirements) # OID Registry This crate is a helper crate, containing a database of OID objects. These objects are intended for use when manipulating ASN.1 grammars and BER/DER encodings, for example. This crate provides only a simple registry (similar to a `HashMap`) by default. This object can be used to get names and descriptions from OID. This crate provides default lists of known OIDs, that can be selected using the build features. By default, the registry has no feature enabled, to avoid embedding a huge database in crates. It also declares constants for most of these OIDs. ```rust use oid_registry::OidRegistry; let mut registry = OidRegistry::default() .with_crypto() // only if the 'crypto' feature is enabled ; let e = registry.get(&oid_registry::OID_PKCS1_SHA256WITHRSA); if let Some(entry) = e { // get sn: sha256WithRSAEncryption println!("sn: {}", entry.sn()); // get description: SHA256 with RSA encryption println!("description: {}", entry.description()); } ``` ## Extending the registry These provided lists are often incomplete, or may lack some specific OIDs. This is why the registry allows adding new entries after construction: ```rust use asn1_rs::oid; use oid_registry::{OidEntry, OidRegistry}; let mut registry = OidRegistry::default(); // entries can be added by creating an OidEntry object: let entry = OidEntry::new("shortName", "description"); registry.insert(oid!(1.2.3.4), entry); // when using static strings, a tuple can also be used directly for the entry: registry.insert(oid!(1.2.3.5), ("shortName", "A description")); ``` ## Versions and compatibility with `asn1-rs` Versions of `oid-registry` must be chosen specifically, to depend on a precise version of `asn1-rs`. The following table summarizes the matching versions: - `oid-registry` 0.7.x depends on `asn1-rs` 0.6.0 - `oid-registry` 0.6.x depends on `asn1-rs` 0.5.0 - `oid-registry` 0.5.x depends on `asn1-rs` 0.4.0 ## Contributing OIDs All OID values, constants, and features are derived from files in the `assets` directory in the build script (see `build.rs`). See `load_file` for documentation of the file format. ## Rust version requirements `oid-registry` requires **Rustc version 1.63 or greater**, based on proc-macro attributes support and `asn1-rs`. # License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/opaque-debug/README.md # [RustCrypto]: Opaque Debug [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] [![Build Status][build-image]][build-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] Macro for opaque Debug trait implementation. ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/opaque-debug.svg [crate-link]: https://crates.io/crates/opaque-debug [docs-image]: https://docs.rs/opaque-debug/badge.svg [docs-link]: https://docs.rs/opaque-debug/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260052-utils [build-image]: https://github.com/RustCrypto/utils/workflows/opaque-debug/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/utils/actions/workflows/opaque-debug.yml [//]: # (general links) [RustCrypto]: https://github.com/rustcrypto ## Files: rust/vendor/pin-project-lite/README.md # pin-project-lite [![crates.io](https://img.shields.io/crates/v/pin-project-lite?style=flat-square&logo=rust)](https://crates.io/crates/pin-project-lite) [![docs.rs](https://img.shields.io/badge/docs.rs-pin--project--lite-blue?style=flat-square&logo=docs.rs)](https://docs.rs/pin-project-lite) [![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license) [![msrv](https://img.shields.io/badge/msrv-1.37-blue?style=flat-square&logo=rust)](https://www.rust-lang.org) [![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/pin-project-lite/ci.yml?branch=main&style=flat-square&logo=github)](https://github.com/taiki-e/pin-project-lite/actions) A lightweight version of [pin-project] written with declarative macros. ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] pin-project-lite = "0.2" ``` ## Examples [`pin_project!`] macro creates a projection type covering all the fields of struct. ```rust use std::pin::Pin; use pin_project_lite::pin_project; pin_project! { struct Struct { #[pin] pinned: T, unpinned: U, } } impl Struct { fn method(self: Pin<&mut Self>) { let this = self.project(); let _: Pin<&mut T> = this.pinned; // Pinned reference to the field let _: &mut U = this.unpinned; // Normal reference to the field } } ``` To use [`pin_project!`] on enums, you need to name the projection type returned from the method. ```rust use std::pin::Pin; use pin_project_lite::pin_project; pin_project! { #[project = EnumProj] enum Enum { Variant { #[pin] pinned: T, unpinned: U }, } } impl Enum { fn method(self: Pin<&mut Self>) { match self.project() { EnumProj::Variant { pinned, unpinned } => { let _: Pin<&mut T> = pinned; let _: &mut U = unpinned; } } } } ``` ## [pin-project] vs pin-project-lite Here are some similarities and differences compared to [pin-project]. ### Similar: Safety pin-project-lite guarantees safety in much the same way as [pin-project]. Both are completely safe unless you write other unsafe code. ### Different: Minimal design This library does not tackle as expansive of a range of use cases as [pin-project] does. If your use case is not already covered, please use [pin-project]. ### Different: No proc-macro related dependencies This is the **only** reason to use this crate. However, **if you already have proc-macro related dependencies in your crate's dependency graph, there is no benefit from using this crate.** (Note: There is almost no difference in the amount of code generated between [pin-project] and pin-project-lite.) ### Different: No useful error messages This macro does not handle any invalid input. So error messages are not to be useful in most cases. If you do need useful error messages, then upon error you can pass the same input to [pin-project] to receive a helpful description of the compile error. ### Different: No support for custom Unpin implementation pin-project supports this by [`UnsafeUnpin`][unsafe-unpin]. (`!Unpin` is supported by both [pin-project][not-unpin] and [pin-project-lite][not-unpin-lite].) ### Different: No support for tuple structs and tuple variants pin-project supports this. [not-unpin]: https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#unpin [pin-project]: https://github.com/taiki-e/pin-project [unsafe-unpin]: https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#unsafeunpin [not-unpin-lite]: https://docs.rs/pin-project-lite/latest/pin_project_lite/macro.pin_project.html#unpin [`pin_project!`]: https://docs.rs/pin-project-lite/latest/pin_project_lite/macro.pin_project.html ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/pin-utils/README.md # pin-utils Utilities for pinning [![Build Status](https://travis-ci.com/rust-lang-nursery/pin-utils.svg?branch=master)](https://travis-ci.com/rust-lang-nursery/pin-utils) [![Crates.io](https://img.shields.io/crates/v/pin-utils.svg)](https://crates.io/crates/pin-utils) [Documentation](https://docs.rs/pin-utils) ## Usage First, add this to your `Cargo.toml`: ```toml [dependencies] pin-utils = "0.1.0-alpha.4" ``` Now, you can use it: ```rust use pin_utils::pin_mut; // And more... ``` The current version of pin-utils requires Rust 1.33 or later. # License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in pin-utils by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/pkg-config/README.md # pkg-config-rs [![Build Status](https://github.com/rust-lang/pkg-config-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/rust-lang/pkg-config-rs/actions) [![Rust](https://img.shields.io/badge/rust-1.31%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/pkg-config-rs/) [Documentation](https://docs.rs/pkg-config) A simple library meant to be used as a build dependency with Cargo packages in order to use the system `pkg-config` tool (if available) to determine where a library is located. You can use this crate directly to probe for specific libraries, or use [system-deps](https://github.com/gdesmott/system-deps) to declare all your `pkg-config` dependencies in `Cargo.toml`. This library requires Rust 1.31+. # Example Find the system library named `foo`, with minimum version 1.2.3: ```rust extern crate pkg_config; fn main() { pkg_config::Config::new().atleast_version("1.2.3").probe("foo").unwrap(); } ``` Find the system library named `foo`, with no version requirement (not recommended): ```rust extern crate pkg_config; fn main() { pkg_config::probe_library("foo").unwrap(); } ``` # External configuration via target-scoped environment variables In cross-compilation context, it is useful to manage separately `PKG_CONFIG_PATH` and a few other variables for the `host` and the `target` platform. The supported variables are: `PKG_CONFIG_PATH`, `PKG_CONFIG_LIBDIR`, and `PKG_CONFIG_SYSROOT_DIR`. Each of these variables can also be supplied with certain prefixes and suffixes, in the following prioritized order: 1. `_` - for example, `PKG_CONFIG_PATH_x86_64-unknown-linux-gnu` 2. `_` - for example, `PKG_CONFIG_PATH_x86_64_unknown_linux_gnu` 3. `_` - for example, `HOST_PKG_CONFIG_PATH` or `TARGET_PKG_CONFIG_PATH` 4. `` - a plain `PKG_CONFIG_PATH` This crate will allow `pkg-config` to be used in cross-compilation if `PKG_CONFIG_SYSROOT_DIR` or `PKG_CONFIG` is set. You can set `PKG_CONFIG_ALLOW_CROSS=1` to bypass the compatibility check, but please note that enabling use of `pkg-config` in cross-compilation without appropriate sysroot and search paths set is likely to break builds. Some Rust sys crates support building vendored libraries from source, which may be a work around for lack of cross-compilation support in `pkg-config`. # License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in pkg-config-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/polyval/README.md # RustCrypto: POLYVAL [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Build Status][build-image]][build-link] [POLYVAL][1] ([RFC 8452][2]) is a [universal hash function][3] which operates over GF(2^128) and can be used for constructing a [Message Authentication Code (MAC)][4]. Its primary intended use is for implementing [AES-GCM-SIV][5], however it is closely related to [GHASH][6] and therefore can also be used to implement [AES-GCM][7] at no cost to performance on little endian architectures. [Documentation][docs-link] ## Security Notes This crate has received one [security audit by NCC Group][8], with no significant findings. We would like to thank [MobileCoin][9] for funding the audit. All implementations contained in the crate are designed to execute in constant time, either by relying on hardware intrinsics (i.e. AVX2 on x86/x86_64), or using a portable implementation which is only constant time on processors which implement constant-time multiplication. It is not suitable for use on processors with a variable-time multiplication operation (e.g. short circuit on multiply-by-zero / multiply-by-one, such as certain 32-bit PowerPC CPUs and some non-ARM microcontrollers). ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/polyval.svg [crate-link]: https://crates.io/crates/polyval [docs-image]: https://docs.rs/polyval/badge.svg [docs-link]: https://docs.rs/polyval/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.49+-blue.svg [build-image]: https://github.com/RustCrypto/universal-hashes/workflows/polyval/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/universal-hashes/actions?query=workflow%3Apolyval [//]: # (footnotes) [1]: https://en.wikipedia.org/wiki/AES-GCM-SIV#Operation [2]: https://tools.ietf.org/html/rfc8452#section-3 [3]: https://en.wikipedia.org/wiki/Universal_hashing [4]: https://en.wikipedia.org/wiki/Message_authentication_code [5]: https://en.wikipedia.org/wiki/AES-GCM-SIV [6]: https://en.wikipedia.org/wiki/Galois/Counter_Mode#Mathematical_basis [7]: https://en.wikipedia.org/wiki/Galois/Counter_Mode [8]: https://research.nccgroup.com/2020/02/26/public-report-rustcrypto-aes-gcm-and-chacha20poly1305-implementation-review/ [9]: https://www.mobilecoin.com/ ## Files: rust/vendor/powerfmt/README.md # `powerfmt` [![minimum rustc: 1.65](https://img.shields.io/badge/minimum%20rustc-1.65-yellowgreen?logo=rust&style=flat-square)](https://www.whatrustisit.com) [![version](https://img.shields.io/crates/v/powerfmt?color=blue&logo=rust&style=flat-square)](https://crates.io/crates/powerfmt) [![build status](https://img.shields.io/github/actions/workflow/status/jhpratt/powerfmt/build.yaml?branch=main&style=flat-square)](https://github.com/jhpratt/powerfmt/actions) Documentation is available [on docs.rs](https://docs.rs/powerfmt). ## Minimum Rust version policy `powerfmt` is guaranteed to compile with the latest stable release of Rust in addition to the two prior minor releases. For example, if the latest stable Rust release is 1.70, then `powerfmt` is guaranteed to compile with Rust 1.68, 1.69, and 1.70. The minimum supported Rust version may be increased to one of the aforementioned versions if doing so provides the end user a benefit. However, the minimum supported Rust version may also be bumped to a version four minor releases prior to the most recent stable release if doing so improves code quality or maintainability. For interoperability with third-party crates, it is guaranteed that there exists a version of that crate that supports the minimum supported Rust version of `powerfmt`. This does not mean that the latest version of the third-party crate supports the minimum supported Rust version of `powerfmt`. ## Contributing Contributions are always welcome! If you have an idea, it's best to float it by me before working on it to ensure no effort is wasted. If there's already an open issue for it, knock yourself out. If you have any questions, feel free to use [Discussions]. Don't hesitate to ask questions — that's what I'm here for! [Discussions]: https://github.com/jhpratt/powerfmt/discussions ## License This project is licensed under either of - [Apache License, Version 2.0](https://github.com/jhpratt/powerfmt/blob/main/LICENSE-Apache) - [MIT license](https://github.com/jhpratt/powerfmt/blob/main/LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in time by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/proc-macro-crate/README.md # proc-macro-crate [![](https://docs.rs/proc-macro-crate/badge.svg)](https://docs.rs/proc-macro-crate/) [![](https://img.shields.io/crates/v/proc-macro-crate.svg)](https://crates.io/crates/proc-macro-crate) [![](https://img.shields.io/crates/d/proc-macro-crate.png)](https://crates.io/crates/proc-macro-crate) [![Build Status](https://travis-ci.org/bkchr/proc-macro-crate.png?branch=master)](https://travis-ci.org/bkchr/proc-macro-crate) Providing support for `$crate` in procedural macros. * [Introduction](#introduction) * [Example](#example) * [License](#license) ### Introduction In `macro_rules!` `$crate` is used to get the path of the crate where a macro is declared in. In procedural macros there is currently no easy way to get this path. A common hack is to import the desired crate with a know name and use this. However, with rust edition 2018 and dropping `extern crate` declarations from `lib.rs`, people start to rename crates in `Cargo.toml` directly. However, this breaks importing the crate, as the proc-macro developer does not know the renamed name of the crate that should be imported. This crate provides a way to get the name of a crate, even if it renamed in `Cargo.toml`. For this purpose a single function `crate_name` is provided. This function needs to be called in the context of a proc-macro with the name of the desired crate. `CARGO_MANIFEST_DIR` will be used to find the current active `Cargo.toml` and this `Cargo.toml` is searched for the desired crate. ### Example ```rust use quote::quote; use syn::Ident; use proc_macro2::Span; use proc_macro_crate::{crate_name, FoundCrate}; fn import_my_crate() { let found_crate = crate_name("my-crate").expect("my-crate is present in `Cargo.toml`"); match found_crate { FoundCrate::Itself => quote!( crate::Something ), FoundCrate::Name(name) => { let ident = Ident::new(&name, Span::call_site()); quote!( #ident::Something ) } }; } ``` ### License Licensed under either of * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. License: Apache-2.0/MIT ## Files: rust/vendor/proc-macro2/README.md # proc-macro2 [github](https://github.com/dtolnay/proc-macro2) [crates.io](https://crates.io/crates/proc-macro2) [docs.rs](https://docs.rs/proc-macro2) [build status](https://github.com/dtolnay/proc-macro2/actions?query=branch%3Amaster) A wrapper around the procedural macro API of the compiler's `proc_macro` crate. This library serves two purposes: - **Bring proc-macro-like functionality to other contexts like build.rs and main.rs.** Types from `proc_macro` are entirely specific to procedural macros and cannot ever exist in code outside of a procedural macro. Meanwhile `proc_macro2` types may exist anywhere including non-macro code. By developing foundational libraries like [syn] and [quote] against `proc_macro2` rather than `proc_macro`, the procedural macro ecosystem becomes easily applicable to many other use cases and we avoid reimplementing non-macro equivalents of those libraries. - **Make procedural macros unit testable.** As a consequence of being specific to procedural macros, nothing that uses `proc_macro` can be executed from a unit test. In order for helper libraries or components of a macro to be testable in isolation, they must be implemented using `proc_macro2`. [syn]: https://github.com/dtolnay/syn [quote]: https://github.com/dtolnay/quote ## Usage ```toml [dependencies] proc-macro2 = "1.0" ``` The skeleton of a typical procedural macro typically looks like this: ```rust extern crate proc_macro; #[proc_macro_derive(MyDerive)] pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = proc_macro2::TokenStream::from(input); let output: proc_macro2::TokenStream = { /* transform input */ }; proc_macro::TokenStream::from(output) } ``` If parsing with [Syn], you'll use [`parse_macro_input!`] instead to propagate parse errors correctly back to the compiler when parsing fails. [`parse_macro_input!`]: https://docs.rs/syn/2.0/syn/macro.parse_macro_input.html ## Unstable features The default feature set of proc-macro2 tracks the most recent stable compiler API. Functionality in `proc_macro` that is not yet stable is not exposed by proc-macro2 by default. To opt into the additional APIs available in the most recent nightly compiler, the `procmacro2_semver_exempt` config flag must be passed to rustc. We will polyfill those nightly-only APIs back to Rust 1.56.0. As these are unstable APIs that track the nightly compiler, minor versions of proc-macro2 may make breaking changes to them at any time. ``` RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build ``` Note that this must not only be done for your crate, but for any crate that depends on your crate. This infectious nature is intentional, as it serves as a reminder that you are outside of the normal semver guarantees. Semver exempt methods are marked as such in the proc-macro2 documentation.
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/psl/README.md # PSL A native Rust library for Mozilla's Public Suffix List [![CI](https://github.com/addr-rs/psl/actions/workflows/ci.yml/badge.svg)](https://github.com/addr-rs/psl/actions/workflows/ci.yml) [![Publish](https://github.com/addr-rs/psl/actions/workflows/update.yaml/badge.svg)](https://github.com/addr-rs/psl/actions/workflows/update.yaml) [![Latest Version](https://img.shields.io/crates/v/psl.svg)](https://crates.io/crates/psl) [![Crates.io downloads](https://img.shields.io/crates/d/psl)](https://crates.io/crates/psl) [![Docs](https://docs.rs/psl/badge.svg)](https://docs.rs/psl) [![Minimum supported Rust version](https://img.shields.io/badge/rustc-1.41+-yellow.svg)](https://www.rust-lang.org) ![Maintenance](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) This library uses Mozilla's [Public Suffix List](https://publicsuffix.org) to reliably determine the suffix of a domain name. It compiles the list down to native Rust code for ultimate speed. This list compilation is done as a separate step by the `Publish` GitHub Action so the crate still compiles very quickly. The `Publish` action automatically checks for updates everyday and pushes an updated crate to crates.io if there were any updates in the upstream domain suffixes. This keeps the crate automatically synchronised with the official list. If you need a dynamic list that can be updated at runtime, though a bit slower, please use the [publicsuffix](https://crates.io/crates/publicsuffix) crate instead (which also has optional support for looking up domain names in any case). ## Setting Up Add this crate to your `Cargo.toml`: ```toml [dependencies] psl = "2" ``` ## Examples ```rust let suffix = psl::suffix(b"www.example.com")?; assert_eq!(suffix, "com"); assert_eq!(suffix.typ(), Some(psl::Type::Icann)); let domain = psl::domain(b"www.example.com")?; assert_eq!(domain, "example.com"); assert_eq!(domain.suffix(), "com"); let domain = psl::domain("www.食狮.中国".as_bytes())?; assert_eq!(domain, "食狮.中国"); assert_eq!(domain.suffix(), "中国"); let domain = psl::domain(b"www.xn--85x722f.xn--55qx5d.cn")?; assert_eq!(domain, "xn--85x722f.xn--55qx5d.cn"); assert_eq!(domain.suffix(), "xn--55qx5d.cn"); let domain = psl::domain(b"a.b.example.uk.com")?; assert_eq!(domain, "example.uk.com"); assert_eq!(domain.suffix(), "uk.com"); let domain = psl::domain(b"_tcp.example.com.")?; assert_eq!(domain, "example.com."); assert_eq!(domain.suffix(), "com."); ``` ## Files: rust/vendor/quote/README.md Rust Quasi-Quoting ================== [github](https://github.com/dtolnay/quote) [crates.io](https://crates.io/crates/quote) [docs.rs](https://docs.rs/quote) [build status](https://github.com/dtolnay/quote/actions?query=branch%3Amaster) This crate provides the [`quote!`] macro for turning Rust syntax tree data structures into tokens of source code. [`quote!`]: https://docs.rs/quote/1.0/quote/macro.quote.html Procedural macros in Rust receive a stream of tokens as input, execute arbitrary Rust code to determine how to manipulate those tokens, and produce a stream of tokens to hand back to the compiler to compile into the caller's crate. Quasi-quoting is a solution to one piece of that — producing tokens to return to the compiler. The idea of quasi-quoting is that we write *code* that we treat as *data*. Within the `quote!` macro, we can write what looks like code to our text editor or IDE. We get all the benefits of the editor's brace matching, syntax highlighting, indentation, and maybe autocompletion. But rather than compiling that as code into the current crate, we can treat it as data, pass it around, mutate it, and eventually hand it back to the compiler as tokens to compile into the macro caller's crate. This crate is motivated by the procedural macro use case, but is a general-purpose Rust quasi-quoting library and is not specific to procedural macros. ```toml [dependencies] quote = "1.0" ``` *Version requirement: Quote supports rustc 1.56 and up.*
    [*Release notes*](https://github.com/dtolnay/quote/releases)
    ## Syntax The quote crate provides a [`quote!`] macro within which you can write Rust code that gets packaged into a [`TokenStream`] and can be treated as data. You should think of `TokenStream` as representing a fragment of Rust source code. [`TokenStream`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.TokenStream.html Within the `quote!` macro, interpolation is done with `#var`. Any type implementing the [`quote::ToTokens`] trait can be interpolated. This includes most Rust primitive types as well as most of the syntax tree types from [`syn`]. [`quote::ToTokens`]: https://docs.rs/quote/1.0/quote/trait.ToTokens.html [`syn`]: https://github.com/dtolnay/syn ```rust let tokens = quote! { struct SerializeWith #generics #where_clause { value: &'a #field_ty, phantom: core::marker::PhantomData<#item_ty>, } impl #generics serde::Serialize for SerializeWith #generics #where_clause { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { #path(self.value, serializer) } } SerializeWith { value: #value, phantom: core::marker::PhantomData::<#item_ty>, } }; ```
    ## Repetition Repetition is done using `#(...)*` or `#(...),*` similar to `macro_rules!`. This iterates through the elements of any variable interpolated within the repetition and inserts a copy of the repetition body for each one. The variables in an interpolation may be a `Vec`, slice, `BTreeSet`, or any `Iterator`. - `#(#var)*` — no separators - `#(#var),*` — the character before the asterisk is used as a separator - `#( struct #var; )*` — the repetition can contain other things - `#( #k => println!("{}", #v), )*` — even multiple interpolations Note that there is a difference between `#(#var ,)*` and `#(#var),*`—the latter does not produce a trailing comma. This matches the behavior of delimiters in `macro_rules!`.
    ## Returning tokens to the compiler The `quote!` macro evaluates to an expression of type `proc_macro2::TokenStream`. Meanwhile Rust procedural macros are expected to return the type `proc_macro::TokenStream`. The difference between the two types is that `proc_macro` types are entirely specific to procedural macros and cannot ever exist in code outside of a procedural macro, while `proc_macro2` types may exist anywhere including tests and non-macro code like main.rs and build.rs. This is why even the procedural macro ecosystem is largely built around `proc_macro2`, because that ensures the libraries are unit testable and accessible in non-macro contexts. There is a [`From`]-conversion in both directions so returning the output of `quote!` from a procedural macro usually looks like `tokens.into()` or `proc_macro::TokenStream::from(tokens)`. [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html
    ## Examples ### Combining quoted fragments Usually you don't end up constructing an entire final `TokenStream` in one piece. Different parts may come from different helper functions. The tokens produced by `quote!` themselves implement `ToTokens` and so can be interpolated into later `quote!` invocations to build up a final result. ```rust let type_definition = quote! {...}; let methods = quote! {...}; let tokens = quote! { #type_definition #methods }; ``` ### Constructing identifiers Suppose we have an identifier `ident` which came from somewhere in a macro input and we need to modify it in some way for the macro output. Let's consider prepending the identifier with an underscore. Simply interpolating the identifier next to an underscore will not have the behavior of concatenating them. The underscore and the identifier will continue to be two separate tokens as if you had written `_ x`. ```rust // incorrect quote! { let mut _#ident = 0; } ``` The solution is to build a new identifier token with the correct value. As this is such a common case, the `format_ident!` macro provides a convenient utility for doing so correctly. ```rust let varname = format_ident!("_{}", ident); quote! { let mut #varname = 0; } ``` Alternatively, the APIs provided by Syn and proc-macro2 can be used to directly build the identifier. This is roughly equivalent to the above, but will not handle `ident` being a raw identifier. ```rust let concatenated = format!("_{}", ident); let varname = syn::Ident::new(&concatenated, ident.span()); quote! { let mut #varname = 0; } ``` ### Making method calls Let's say our macro requires some type specified in the macro input to have a constructor called `new`. We have the type in a variable called `field_type` of type `syn::Type` and want to invoke the constructor. ```rust // incorrect quote! { let value = #field_type::new(); } ``` This works only sometimes. If `field_type` is `String`, the expanded code contains `String::new()` which is fine. But if `field_type` is something like `Vec` then the expanded code is `Vec::new()` which is invalid syntax. Ordinarily in handwritten Rust we would write `Vec::::new()` but for macros often the following is more convenient. ```rust quote! { let value = <#field_type>::new(); } ``` This expands to `>::new()` which behaves correctly. A similar pattern is appropriate for trait methods. ```rust quote! { let value = <#field_type as core::default::Default>::default(); } ```
    ## Hygiene Any interpolated tokens preserve the `Span` information provided by their `ToTokens` implementation. Tokens that originate within a `quote!` invocation are spanned with [`Span::call_site()`]. [`Span::call_site()`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html#method.call_site A different span can be provided explicitly through the [`quote_spanned!`] macro. [`quote_spanned!`]: https://docs.rs/quote/1.0/quote/macro.quote_spanned.html
    ## Non-macro code generators When using `quote` in a build.rs or main.rs and writing the output out to a file, consider having the code generator pass the tokens through [prettyplease] before writing. This way if an error occurs in the generated code it is convenient for a human to read and debug. Be aware that no kind of hygiene or span information is retained when tokens are written to a file; the conversion from tokens to source code is lossy. Example usage in build.rs: ```rust let output = quote! { ... }; let syntax_tree = syn::parse2(output).unwrap(); let formatted = prettyplease::unparse(&syntax_tree); let out_dir = env::var_os("OUT_DIR").unwrap(); let dest_path = Path::new(&out_dir).join("out.rs"); fs::write(dest_path, formatted).unwrap(); ``` [prettyplease]: https://github.com/dtolnay/prettyplease
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/radix_trie/README.md Rust Radix Trie ==== [![Unix Build Status](https://travis-ci.org/michaelsproul/rust_radix_trie.svg?branch=master)](https://travis-ci.org/michaelsproul/rust_radix_trie) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/d2voj1te0m7agfne/branch/master?svg=true)](https://ci.appveyor.com/project/michaelsproul/rust-radix-trie/branch/master) This is a [Radix Trie][radix-wiki] implementation in Rust, building on the lessons learnt from `TrieMap` and [Sequence Trie][seq-trie]. You can read about my experience implementing this data structure [here][radix-paper]. # Help Wanted, Enquire Within *Since writing this code I haven't used it in anger (or production) so it is no doubt in need of some maintenance, testing and optimisation love. If you would like to help out, try solving an open issue, optimise something, or just have a poke around! Thanks :)* # Features * Compressed nodes. Common key prefixes are stored only once. * Trie-specific methods to look-up closest ancestors and descendants. * Key Generic. Any type that can be serialised as a vector of bytes can be used as a key. * Safe - no unsafe code. # Documentation https://docs.rs/radix_trie/ # Usage Available on [Crates.io][] as [`radix_trie`][radix-crate]. Just add `radix_trie` to the dependencies section of your `Cargo.toml`, like so: ```toml radix_trie = "0.2" ``` # Contributors Made by: * Allan Simon ([@allan-simon](https://github.com/allan-simon)) * Andrew Smith ([@andrewcsmith](https://github.com/andrewcsmith)) * Arthur Carcano ([@NougatRillettes](https://github.com/NougatRillettes)) * Devin Ragotzy ([@DevinR528](https://github.com/DevinR528)) * [@hanabi1224](https://github.com/hanabi1224) * Jakob Dalsgaard ([@jakobdalsgaard](https://github.com/jakobdalsgaard)) * Michael Sproul ([@michaelsproul](https://github.com/michaelsproul)) * Robin Lambertz ([@roblabla](https://github.com/roblabla)) * Sergey ([@Albibek](https://github.com/Albibek)) * Stuart Hinson ([@stuarth](https://github.com/stuarth)) * Vinzent Steinberg ([@vks](https://github.com/vks)) # License MIT License. Copyright © Michael Sproul and contributors 2015-present. [radix-wiki]: http://en.wikipedia.org/wiki/Radix_tree [seq-trie]: https://github.com/michaelsproul/rust_sequence_trie [radix-paper]: https://michaelsproul.github.io/rust_radix_paper/ [crates.io]: https://crates.io/ [radix-crate]: https://crates.io/crates/radix_trie ## Files: rust/vendor/rand/README.md # Rand [![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Crate](https://img.shields.io/crates/v/rand.svg)](https://crates.io/crates/rand) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand) [![API](https://docs.rs/rand/badge.svg)](https://docs.rs/rand) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.36+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) A Rust library for random number generation, featuring: - Easy random value generation and usage via the [`Rng`](https://docs.rs/rand/*/rand/trait.Rng.html), [`SliceRandom`](https://docs.rs/rand/*/rand/seq/trait.SliceRandom.html) and [`IteratorRandom`](https://docs.rs/rand/*/rand/seq/trait.IteratorRandom.html) traits - Secure seeding via the [`getrandom` crate](https://crates.io/crates/getrandom) and fast, convenient generation via [`thread_rng`](https://docs.rs/rand/*/rand/fn.thread_rng.html) - A modular design built over [`rand_core`](https://crates.io/crates/rand_core) ([see the book](https://rust-random.github.io/book/crates.html)) - Fast implementations of the best-in-class [cryptographic](https://rust-random.github.io/book/guide-rngs.html#cryptographically-secure-pseudo-random-number-generators-csprngs) and [non-cryptographic](https://rust-random.github.io/book/guide-rngs.html#basic-pseudo-random-number-generators-prngs) generators - A flexible [`distributions`](https://docs.rs/rand/*/rand/distributions/index.html) module - Samplers for a large number of random number distributions via our own [`rand_distr`](https://docs.rs/rand_distr) and via the [`statrs`](https://docs.rs/statrs/0.13.0/statrs/) - [Portably reproducible output](https://rust-random.github.io/book/portability.html) - `#[no_std]` compatibility (partial) - *Many* performance optimisations It's also worth pointing out what `rand` *is not*: - Small. Most low-level crates are small, but the higher-level `rand` and `rand_distr` each contain a lot of functionality. - Simple (implementation). We have a strong focus on correctness, speed and flexibility, but not simplicity. If you prefer a small-and-simple library, there are alternatives including [fastrand](https://crates.io/crates/fastrand) and [oorandom](https://crates.io/crates/oorandom). - Slow. We take performance seriously, with considerations also for set-up time of new distributions, commonly-used parameters, and parameters of the current sampler. Documentation: - [The Rust Rand Book](https://rust-random.github.io/book) - [API reference (master branch)](https://rust-random.github.io/rand) - [API reference (docs.rs)](https://docs.rs/rand) ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] rand = "0.8.4" ``` To get started using Rand, see [The Book](https://rust-random.github.io/book). ## Versions Rand is *mature* (suitable for general usage, with infrequent breaking releases which minimise breakage) but not yet at 1.0. We maintain compatibility with pinned versions of the Rust compiler (see below). Current Rand versions are: - Version 0.7 was released in June 2019, moving most non-uniform distributions to an external crate, moving `from_entropy` to `SeedableRng`, and many small changes and fixes. - Version 0.8 was released in December 2020 with many small changes. A detailed [changelog](CHANGELOG.md) is available for releases. When upgrading to the next minor series (especially 0.4 → 0.5), we recommend reading the [Upgrade Guide](https://rust-random.github.io/book/update.html). Rand has not yet reached 1.0 implying some breaking changes may arrive in the future ([SemVer](https://semver.org/) allows each 0.x.0 release to include breaking changes), but is considered *mature*: breaking changes are minimised and breaking releases are infrequent. Rand libs have inter-dependencies and make use of the [semver trick](https://github.com/dtolnay/semver-trick/) in order to make traits compatible across crate versions. (This is especially important for `RngCore` and `SeedableRng`.) A few crate releases are thus compatibility shims, depending on the *next* lib version (e.g. `rand_core` versions `0.2.2` and `0.3.1`). This means, for example, that `rand_core_0_4_0::SeedableRng` and `rand_core_0_3_0::SeedableRng` are distinct, incompatible traits, which can cause build errors. Usually, running `cargo update` is enough to fix any issues. ### Yanked versions Some versions of Rand crates have been yanked ("unreleased"). Where this occurs, the crate's CHANGELOG *should* be updated with a rationale, and a search on the issue tracker with the keyword `yank` *should* uncover the motivation. ### Rust version requirements Since version 0.8, Rand requires **Rustc version 1.36 or greater**. Rand 0.7 requires Rustc 1.32 or greater while versions 0.5 require Rustc 1.22 or greater, and 0.4 and 0.3 (since approx. June 2017) require Rustc version 1.15 or greater. Subsets of the Rand code may work with older Rust versions, but this is not supported. Continuous Integration (CI) will always test the minimum supported Rustc version (the MSRV). The current policy is that this can be updated in any Rand release if required, but the change must be noted in the changelog. ## Crate Features Rand is built with these features enabled by default: - `std` enables functionality dependent on the `std` lib - `alloc` (implied by `std`) enables functionality requiring an allocator - `getrandom` (implied by `std`) is an optional dependency providing the code behind `rngs::OsRng` - `std_rng` enables inclusion of `StdRng`, `thread_rng` and `random` (the latter two *also* require that `std` be enabled) Optionally, the following dependencies can be enabled: - `log` enables logging via the `log` crate Additionally, these features configure Rand: - `small_rng` enables inclusion of the `SmallRng` PRNG - `nightly` enables some optimizations requiring nightly Rust - `simd_support` (experimental) enables sampling of SIMD values (uniformly random SIMD integers and floats), requiring nightly Rust - `min_const_gen` enables generating random arrays of any size using min-const-generics, requiring Rust ≥ 1.51. Note that nightly features are not stable and therefore not all library and compiler versions will be compatible. This is especially true of Rand's experimental `simd_support` feature. Rand supports limited functionality in `no_std` mode (enabled via `default-features = false`). In this case, `OsRng` and `from_entropy` are unavailable (unless `getrandom` is enabled), large parts of `seq` are unavailable (unless `alloc` is enabled), and `thread_rng` and `random` are unavailable. ### WASM support The WASM target `wasm32-unknown-unknown` is not *automatically* supported by `rand` or `getrandom`. To solve this, either use a different target such as `wasm32-wasi` or add a direct dependency on `getrandom` with the `js` feature (if the target supports JavaScript). See [getrandom#WebAssembly support](https://docs.rs/getrandom/latest/getrandom/#webassembly-support). # License Rand is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details. ## Files: rust/vendor/rand_chacha/README.md # rand_chacha [![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Latest version](https://img.shields.io/crates/v/rand_chacha.svg)](https://crates.io/crates/rand_chacha) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_chacha) [![API](https://docs.rs/rand_chacha/badge.svg)](https://docs.rs/rand_chacha) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.36+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) A cryptographically secure random number generator that uses the ChaCha algorithm. ChaCha is a stream cipher designed by Daniel J. Bernstein[^1], that we use as an RNG. It is an improved variant of the Salsa20 cipher family, which was selected as one of the "stream ciphers suitable for widespread adoption" by eSTREAM[^2]. The RNGs provided by this crate are implemented via the fast stream ciphers of the [`c2-chacha`](https://crates.io/crates/c2-chacha) crate. Links: - [API documentation (master)](https://rust-random.github.io/rand/rand_chacha) - [API documentation (docs.rs)](https://docs.rs/rand_chacha) - [Changelog](https://github.com/rust-random/rand/blob/master/rand_chacha/CHANGELOG.md) [rand]: https://crates.io/crates/rand [^1]: D. J. Bernstein, [*ChaCha, a variant of Salsa20*]( https://cr.yp.to/chacha.html) [^2]: [eSTREAM: the ECRYPT Stream Cipher Project]( http://www.ecrypt.eu.org/stream/) ## Crate Features `rand_chacha` is `no_std` compatible when disabling default features; the `std` feature can be explicitly required to re-enable `std` support. Using `std` allows detection of CPU features and thus better optimisation. # License `rand_chacha` is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details. ## Files: rust/vendor/rand_core/README.md # rand_core [![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Latest version](https://img.shields.io/crates/v/rand_core.svg)](https://crates.io/crates/rand_core) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_core) [![API](https://docs.rs/rand_core/badge.svg)](https://docs.rs/rand_core) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.36+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) Core traits and error types of the [rand] library, plus tools for implementing RNGs. This crate is intended for use when implementing the core trait, `RngCore`; it defines the core traits to be implemented as well as several small functions to aid in their implementation and types required for error handling. The main [rand] crate re-exports most items defined in this crate, along with tools to convert the integer samples generated by `RngCore` to many different applications (including sampling from restricted ranges, conversion to floating point, list permutations and secure initialisation of RNGs). Most users should prefer to use the main [rand] crate. Links: - [API documentation (master)](https://rust-random.github.io/rand/rand_core) - [API documentation (docs.rs)](https://docs.rs/rand_core) - [Changelog](https://github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md) [rand]: https://crates.io/crates/rand ## Functionality The `rand_core` crate provides: - base random number generator traits - error-reporting types - functionality to aid implementation of RNGs The traits and error types are also available via `rand`. ## Versions The current version is: ``` rand_core = "0.6.0" ``` Rand libs have inter-dependencies and make use of the [semver trick](https://github.com/dtolnay/semver-trick/) in order to make traits compatible across crate versions. (This is especially important for `RngCore` and `SeedableRng`.) A few crate releases are thus compatibility shims, depending on the *next* lib version (e.g. `rand_core` versions `0.2.2` and `0.3.1`). This means, for example, that `rand_core_0_4_0::SeedableRng` and `rand_core_0_3_0::SeedableRng` are distinct, incompatible traits, which can cause build errors. Usually, running `cargo update` is enough to fix any issues. ## Crate Features `rand_core` supports `no_std` and `alloc`-only configurations, as well as full `std` functionality. The differences between `no_std` and full `std` are small, comprising `RngCore` support for `Box` types where `R: RngCore`, `std::io::Read` support for types supporting `RngCore`, and extensions to the `Error` type's functionality. The `std` feature is *not enabled by default*. This is primarily to avoid build problems where one crate implicitly requires `rand_core` with `std` support and another crate requires `rand` *without* `std` support. However, the `rand` crate continues to enable `std` support by default, both for itself and `rand_core`. The `serde1` feature can be used to derive `Serialize` and `Deserialize` for RNG implementations that use the `BlockRng` or `BlockRng64` wrappers. # License `rand_core` is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details. ## Files: rust/vendor/regex/README.md regex ===== A Rust library for parsing, compiling, and executing regular expressions. Its syntax is similar to Perl-style regular expressions, but lacks a few features like look around and backreferences. In exchange, all searches execute in linear time with respect to the size of the regular expression and search text. Much of the syntax and implementation is inspired by [RE2](https://github.com/google/re2). [![Build status](https://github.com/rust-lang/regex/workflows/ci/badge.svg)](https://github.com/rust-lang/regex/actions) [![Crates.io](https://img.shields.io/crates/v/regex.svg)](https://crates.io/crates/regex) [![Rust](https://img.shields.io/badge/rust-1.41.1%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/regex) ### Documentation [Module documentation with examples](https://docs.rs/regex). The module documentation also includes a comprehensive description of the syntax supported. Documentation with examples for the various matching functions and iterators can be found on the [`Regex` type](https://docs.rs/regex/*/regex/struct.Regex.html). ### Usage Add this to your `Cargo.toml`: ```toml [dependencies] regex = "1.5" ``` Here's a simple example that matches a date in YYYY-MM-DD format and prints the year, month and day: ```rust use regex::Regex; fn main() { let re = Regex::new(r"(?x) (?P\d{4}) # the year - (?P\d{2}) # the month - (?P\d{2}) # the day ").unwrap(); let caps = re.captures("2010-03-14").unwrap(); assert_eq!("2010", &caps["year"]); assert_eq!("03", &caps["month"]); assert_eq!("14", &caps["day"]); } ``` If you have lots of dates in text that you'd like to iterate over, then it's easy to adapt the above example with an iterator: ```rust use regex::Regex; const TO_SEARCH: &'static str = " On 2010-03-14, foo happened. On 2014-10-14, bar happened. "; fn main() { let re = Regex::new(r"(\d{4})-(\d{2})-(\d{2})").unwrap(); for caps in re.captures_iter(TO_SEARCH) { // Note that all of the unwraps are actually OK for this regex // because the only way for the regex to match is if all of the // capture groups match. This is not true in general though! println!("year: {}, month: {}, day: {}", caps.get(1).unwrap().as_str(), caps.get(2).unwrap().as_str(), caps.get(3).unwrap().as_str()); } } ``` This example outputs: ```text year: 2010, month: 03, day: 14 year: 2014, month: 10, day: 14 ``` ### Usage: Avoid compiling the same regex in a loop It is an anti-pattern to compile the same regular expression in a loop since compilation is typically expensive. (It takes anywhere from a few microseconds to a few **milliseconds** depending on the size of the regex.) Not only is compilation itself expensive, but this also prevents optimizations that reuse allocations internally to the matching engines. In Rust, it can sometimes be a pain to pass regular expressions around if they're used from inside a helper function. Instead, we recommend using the [`lazy_static`](https://crates.io/crates/lazy_static) crate to ensure that regular expressions are compiled exactly once. For example: ```rust,ignore use regex::Regex; fn some_helper_function(text: &str) -> bool { lazy_static! { static ref RE: Regex = Regex::new("...").unwrap(); } RE.is_match(text) } ``` Specifically, in this example, the regex will be compiled when it is used for the first time. On subsequent uses, it will reuse the previous compilation. ### Usage: match regular expressions on `&[u8]` The main API of this crate (`regex::Regex`) requires the caller to pass a `&str` for searching. In Rust, an `&str` is required to be valid UTF-8, which means the main API can't be used for searching arbitrary bytes. To match on arbitrary bytes, use the `regex::bytes::Regex` API. The API is identical to the main API, except that it takes an `&[u8]` to search on instead of an `&str`. By default, `.` will match any *byte* using `regex::bytes::Regex`, while `.` will match any *UTF-8 encoded Unicode scalar value* using the main API. This example shows how to find all null-terminated strings in a slice of bytes: ```rust use regex::bytes::Regex; let re = Regex::new(r"(?P[^\x00]+)\x00").unwrap(); let text = b"foo\x00bar\x00baz\x00"; // Extract all of the strings without the null terminator from each match. // The unwrap is OK here since a match requires the `cstr` capture to match. let cstrs: Vec<&[u8]> = re.captures_iter(text) .map(|c| c.name("cstr").unwrap().as_bytes()) .collect(); assert_eq!(vec![&b"foo"[..], &b"bar"[..], &b"baz"[..]], cstrs); ``` Notice here that the `[^\x00]+` will match any *byte* except for `NUL`. When using the main API, `[^\x00]+` would instead match any valid UTF-8 sequence except for `NUL`. ### Usage: match multiple regular expressions simultaneously This demonstrates how to use a `RegexSet` to match multiple (possibly overlapping) regular expressions in a single scan of the search text: ```rust use regex::RegexSet; let set = RegexSet::new(&[ r"\w+", r"\d+", r"\pL+", r"foo", r"bar", r"barfoo", r"foobar", ]).unwrap(); // Iterate over and collect all of the matches. let matches: Vec<_> = set.matches("foobar").into_iter().collect(); assert_eq!(matches, vec![0, 2, 3, 4, 6]); // You can also test whether a particular regex matched: let matches = set.matches("foobar"); assert!(!matches.matched(5)); assert!(matches.matched(6)); ``` ### Usage: enable SIMD optimizations SIMD optimizations are enabled automatically on Rust stable 1.27 and newer. For nightly versions of Rust, this requires a recent version with the SIMD features stabilized. ### Usage: a regular expression parser This repository contains a crate that provides a well tested regular expression parser, abstract syntax and a high-level intermediate representation for convenient analysis. It provides no facilities for compilation or execution. This may be useful if you're implementing your own regex engine or otherwise need to do analysis on the syntax of a regular expression. It is otherwise not recommended for general use. [Documentation `regex-syntax`.](https://docs.rs/regex-syntax) ### Crate features This crate comes with several features that permit tweaking the trade off between binary size, compilation time and runtime performance. Users of this crate can selectively disable Unicode tables, or choose from a variety of optimizations performed by this crate to disable. When all of these features are disabled, runtime match performance may be much worse, but if you're matching on short strings, or if high performance isn't necessary, then such a configuration is perfectly serviceable. To disable all such features, use the following `Cargo.toml` dependency configuration: ```toml [dependencies.regex] version = "1.3" default-features = false # regex currently requires the standard library, you must re-enable it. features = ["std"] ``` This will reduce the dependency tree of `regex` down to a single crate (`regex-syntax`). The full set of features one can disable are [in the "Crate features" section of the documentation](https://docs.rs/regex/*/#crate-features). ### Minimum Rust version policy This crate's minimum supported `rustc` version is `1.41.1`. The current **tentative** policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if regex 1.0 requires Rust 1.20.0, then regex 1.0.z for all values of `z` will also require Rust 1.20.0 or newer. However, regex 1.y for `y > 0` may require a newer minimum version of Rust. In general, this crate will be conservative with respect to the minimum supported version of Rust. ### License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. The data in `regex-syntax/src/unicode_tables/` is licensed under the Unicode License Agreement ([LICENSE-UNICODE](https://www.unicode.org/copyright.html#License)). ## Files: rust/vendor/regex/src/testdata/README Test data was taken from the Go distribution, which was in turn taken from the testregex test suite: http://www2.research.att.com/~astopen/testregex/testregex.html The LICENSE in this directory corresponds to the LICENSE that the data was released under. The tests themselves were modified for RE2/Go. A couple were modified further by me (Andrew Gallant) (only in repetition.dat) so that RE2/Go would pass them. (Yes, it seems like RE2/Go includes failing test cases.) This may or may not have been a bad idea, but I think being consistent with an established Regex library is worth something. Note that these files are read by 'scripts/regex-match-tests.py' and turned into Rust tests found in 'regex_macros/tests/matches.rs'. ## Files: rust/vendor/rstest/README.md [![Crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] [![Status][test-action-image]][test-action-link] [![Apache 2.0 Licensed][license-apache-image]][license-apache-link] [![MIT Licensed][license-mit-image]][license-mit-link] # Fixture-based test framework for Rust ## Introduction `rstest` uses procedural macros to help you on writing fixtures and table-based tests. To use it, add the following lines to your `Cargo.toml` file: ``` [dev-dependencies] rstest = "0.17.0" ``` ### Fixture The core idea is that you can inject your test dependencies by passing them as test arguments. In the following example, a `fixture` is defined and then used in two tests, simply providing it as an argument: ```rust use rstest::*; #[fixture] pub fn fixture() -> u32 { 42 } #[rstest] fn should_success(fixture: u32) {     assert_eq!(fixture, 42); } #[rstest] fn should_fail(fixture: u32) {     assert_ne!(fixture, 42); } ``` ### Parametrize You can also inject values in some other ways. For instance, you can create a set of tests by simply providing the injected values for each case: `rstest` will generate an independent test for each case. ```rust use rstest::rstest; #[rstest] #[case(0, 0)] #[case(1, 1)] #[case(2, 1)] #[case(3, 2)] #[case(4, 3)] fn fibonacci_test(#[case] input: u32, #[case] expected: u32) { assert_eq!(expected, fibonacci(input)) } ``` Running `cargo test` in this case executes five tests: ```bash running 5 tests test fibonacci_test::case_1 ... ok test fibonacci_test::case_2 ... ok test fibonacci_test::case_3 ... ok test fibonacci_test::case_4 ... ok test fibonacci_test::case_5 ... ok test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ``` If you need to just providing a bunch of values for which you need to run your test, you can use `#[values(list, of, values)]` argument attribute: ```rust use rstest::rstest; #[rstest] fn should_be_invalid( #[values(None, Some(""), Some(" "))] value: Option<&str> ) { assert!(!valid(value)) } ``` Or create a _matrix_ test by using _list of values_ for some variables that will generate the cartesian product of all the values. #### Use Parametrize definition in more tests If you need to use a test list for more than one test you can use [`rstest_reuse`][reuse-crate-link] crate. With this helper crate you can define a template and use it everywhere . ```rust use rstest::rstest; use rstest_reuse::{self, *}; #[template] #[rstest] #[case(2, 2)] #[case(4/2, 2)] fn two_simple_cases(#[case] a: u32, #[case] b: u32) {} #[apply(two_simple_cases)] fn it_works(#[case] a: u32, #[case] b: u32) { assert!(a == b); } ``` See [`rstest_reuse`][reuse-crate-link] for more dettails. ### Magic Conversion If you need a value where its type implement `FromStr()` trait you can use a literal string to build it: ```rust # use rstest::rstest; # use std::net::SocketAddr; #[rstest] #[case("1.2.3.4:8080", 8080)] #[case("127.0.0.1:9000", 9000)] fn check_port(#[case] addr: SocketAddr, #[case] expected: u16) { assert_eq!(expected, addr.port()); } ``` You can use this feature also in value list and in fixture default value. ### Async `rstest` provides out of the box `async` support. Just mark your test function as `async` and it'll use `#[async-std::test]` to annotate it. This feature can be really useful to build async parametric tests using a tidy syntax: ```rust use rstest::*; #[rstest] #[case(5, 2, 3)] #[should_panic] #[case(42, 40, 1)] async fn my_async_test(#[case] expected: u32, #[case] a: u32, #[case] b: u32) { assert_eq!(expected, async_sum(a, b).await); } ``` Currently only `async-std` is supported out of the box. But if you need to use another runtime that provide it's own test attribute (i.e. `tokio::test` or `actix_rt::test`) you can use it in your `async` test like described in [Inject Test Attribute](#inject-test-attribute). To use this feature, you need to enable `attributes` in the `async-std` features list in your `Cargo.toml`: ```toml async-std = { version = "1.5", features = ["attributes"] } ``` If your test input is an async value (fixture or test parameter) you can use `#[future]` attribute to remove `impl Future` boilerplate and just use `T`: ```rust use rstest::*; #[fixture] async fn base() -> u32 { 42 } #[rstest] #[case(21, async { 2 })] #[case(6, async { 7 })] async fn my_async_test(#[future] base: u32, #[case] expected: u32, #[future] #[case] div: u32) { assert_eq!(expected, base.await / div.await); } ``` As you noted you should `.await` all _future_ values and this some times can be really boring. In this case you can use `#[timeout(awt)]` to _awaiting_ an input or annotating your function with `#[awt]` attributes to globally `.await` all your _future_ inputs. Previous code can be simplified like follow: ```rust use rstest::*; # #[fixture] # async fn base() -> u32 { 42 } #[rstest] #[case(21, async { 2 })] #[case(6, async { 7 })] #[awt] async fn global(#[future] base: u32, #[case] expected: u32, #[future] #[case] div: u32) { assert_eq!(expected, base / div); } #[rstest] #[case(21, async { 2 })] #[case(6, async { 7 })] async fn single(#[future] base: u32, #[case] expected: u32, #[future(awt)] #[case] div: u32) { assert_eq!(expected, base.await / div); } ``` ### Test `#[timeout()]` You can define an execution timeout for your tests with `#[timeout()]` attribute. Timeouts works both for sync and async tests and is runtime agnostic. `#[timeout()]` take an expression that should return a `std::time::Duration`. Follow a simple async example: ```rust use rstest::*; use std::time::Duration; async fn delayed_sum(a: u32, b: u32,delay: Duration) -> u32 { async_std::task::sleep(delay).await; a + b } #[rstest] #[timeout(Duration::from_millis(80))] async fn single_pass() { assert_eq!(4, delayed_sum(2, 2, ms(10)).await); } ``` In this case test pass because the delay is just 10 milliseconds and timeout is 80 milliseconds. You can use `timeout` attribute like any other attibute in your tests and you can override a group timeout with a case specific one. In the follow example we have 3 tests where first and third use 100 millis but the second one use 10 millis. Another valuable point in this example is to use an expression to compute the duration. ```rust fn ms(ms: u32) -> Duration { Duration::from_millis(ms.into()) } #[rstest] #[case::pass(ms(1), 4)] #[timeout(ms(10))] #[case::fail_timeout(ms(60), 4)] #[case::fail_value(ms(1), 5)] #[timeout(ms(100))] async fn group_one_timeout_override(#[case] delay: Duration, #[case] expected: u32) { assert_eq!(expected, delayed_sum(2, 2, delay).await); } ``` If you want to use `timeout` for `async` test you need to use `async-timeout` feature (enabled by default). ### Inject Test Attribute If you would like to use another `test` attribute for your test you can simply indicate it in your test function's attributes. For instance if you want to test some async function with use `actix_rt::test` attribute you can just write: ```rust use rstest::*; use actix_rt; use std::future::Future; #[rstest] #[case(2, async { 4 })] #[case(21, async { 42 })] #[actix_rt::test] async fn my_async_test(#[case] a: u32, result: #[case] #[future] u32) { assert_eq!(2 * a, result.await); } ``` Just the attributes that ends with `test` (last path segment) can be injected. ### Use `#[once]` Fixture If you need to a fixture that should be inizialized just once for all tests you can use `#[once]` attribute. `rstest` call your fixture function just once and return a reference to your function result to all your tests: ```rust #[fixture] #[once] fn once_fixture() -> i32 { 42 } #[rstest] fn single(once_fixture: &i32) { // All tests that use once_fixture will share the same reference to once_fixture() // function result. assert_eq!(&42, once_fixture) } ``` ## Complete Example All these features can be used together with a mixture of fixture variables, fixed cases and bunch of values. For instance, you might need two test cases which test for panics, one for a logged in user and one for a guest user. ```rust use rstest::*; #[fixture] fn repository() -> InMemoryRepository { let mut r = InMemoryRepository::default(); // fill repository with some data r } #[fixture] fn alice() -> User { User::logged("Alice", "2001-10-04", "London", "UK") } #[rstest] #[case::authed_user(alice())] // We can use `fixture` also as standard function #[case::guest(User::Guest)] // We can give a name to every case : `guest` in this case // and `authed_user` #[should_panic(expected = "Invalid query error")] // We whould test a panic fn should_be_invalid_query_error( repository: impl Repository, #[case] user: User, #[values(" ", "^%$some#@invalid!chars", ".n.o.d.o.t.s.")] query: &str, ) { repository.find_items(&user, query).unwrap(); } ``` This example will generate exactly 6 tests grouped by 2 different cases: ``` running 6 tests test should_be_invalid_query_error::case_1_authed_user::query_1_____ - should panic ... ok test should_be_invalid_query_error::case_2_guest::query_2_____someinvalid_chars__ - should panic ... ok test should_be_invalid_query_error::case_1_authed_user::query_2_____someinvalid_chars__ - should panic ... ok test should_be_invalid_query_error::case_2_guest::query_3____n_o_d_o_t_s___ - should panic ... ok test should_be_invalid_query_error::case_1_authed_user::query_3____n_o_d_o_t_s___ - should panic ... ok test should_be_invalid_query_error::case_2_guest::query_1_____ - should panic ... ok test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s ``` Note that the names of the values _try_ to convert the input expression in a Rust valid identifier name to help you to find wich tests fail. ## More Is that all? Not quite yet! A fixture can be injected by another fixture and they can be called using just some of its arguments. ```rust #[fixture] fn user(#[default("Alice")] name: &str, #[default(22)] age: u8) -> User { User::new(name, age) } #[rstest] fn is_alice(user: User) { assert_eq!(user.name(), "Alice") } #[rstest] fn is_22(user: User) { assert_eq!(user.age(), 22) } #[rstest] fn is_bob(#[with("Bob")] user: User) { assert_eq!(user.name(), "Bob") } #[rstest] fn is_42(#[with("", 42)] user: User) { assert_eq!(user.age(), 42) } ``` As you noted you can provide default values without the need of a fixture to define it. Finally if you need tracing the input values you can just add the `trace` attribute to your test to enable the dump of all input variables. ```rust #[rstest] #[case(42, "FortyTwo", ("minus twelve", -12))] #[case(24, "TwentyFour", ("minus twentyfour", -24))] #[trace] //This attribute enable traceing fn should_fail(#[case] number: u32, #[case] name: &str, #[case] tuple: (&str, i32)) { assert!(false); // <- stdout come out just for failed tests } ``` ``` running 2 tests test should_fail::case_1 ... FAILED test should_fail::case_2 ... FAILED failures: ---- should_fail::case_1 stdout ---- ------------ TEST ARGUMENTS ------------ number = 42 name = "FortyTwo" tuple = ("minus twelve", -12) -------------- TEST START -------------- thread 'should_fail::case_1' panicked at 'assertion failed: false', src/main.rs:64:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. ---- should_fail::case_2 stdout ---- ------------ TEST ARGUMENTS ------------ number = 24 name = "TwentyFour" tuple = ("minus twentyfour", -24) -------------- TEST START -------------- thread 'should_fail::case_2' panicked at 'assertion failed: false', src/main.rs:64:5 failures: should_fail::case_1 should_fail::case_2 test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ``` In case one or more variables don't implement the `Debug` trait, an error is raised, but it's also possible to exclude a variable using the `#[notrace]` argument attribute. You can learn more on [Docs][docs-link] and find more examples in [`tests/resources`](tests/resources) directory. ## Changelog See [CHANGELOG.md](CHANGELOG.md) ## License Licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or [license-apache-link]) * MIT license [LICENSE-MIT](LICENSE-MIT) or [license-MIT-link] at your option. [//]: # (links) [crate-image]: https://img.shields.io/crates/v/rstest.svg [crate-link]: https://crates.io/crates/rstest [docs-image]: https://docs.rs/rstest/badge.svg [docs-link]: https://docs.rs/rstest/ [test-action-image]: https://github.com/la10736/rstest/workflows/Test/badge.svg [test-action-link]: https://github.com/la10736/rstest/actions?query=workflow:Test [license-apache-image]: https://img.shields.io/badge/license-Apache2.0-blue.svg [license-mit-image]: https://img.shields.io/badge/license-MIT-blue.svg [license-apache-link]: http://www.apache.org/licenses/LICENSE-2.0 [license-MIT-link]: http://opensource.org/licenses/MIT [reuse-crate-link]: https://crates.io/crates/rstest_reuse ## Files: rust/vendor/rstest_macros/README.md [![Crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] [![Status][test-action-image]][test-action-link] [![Apache 2.0 Licensed][license-apache-image]][license-apache-link] [![MIT Licensed][license-mit-image]][license-mit-link] # `rstest`'s Macros Crate See [`rstest`][crate-link]. [crate-image]: https://img.shields.io/crates/v/rstest.svg [crate-link]: https://crates.io/crates/rstest [docs-image]: https://docs.rs/rstest/badge.svg [docs-link]: https://docs.rs/rstest/ [test-action-image]: https://github.com/la10736/rstest/workflows/Test/badge.svg [test-action-link]: https://github.com/la10736/rstest/actions?query=workflow:Test [license-apache-image]: https://img.shields.io/badge/license-Apache2.0-blue.svg [license-mit-image]: https://img.shields.io/badge/license-MIT-blue.svg [license-apache-link]: http://www.apache.org/licenses/LICENSE-2.0 [license-MIT-link]: http://opensource.org/licenses/MIT [reuse-crate-link]: https://crates.io/crates/rstest_reuse ## Files: rust/vendor/rustc_version/README.md rustc-version-rs ================ [![Documentation](https://docs.rs/rustc_version/badge.svg)](https://docs.rs/rustc_version/) [![Crates.io](https://img.shields.io/crates/v/rustc_version.svg)](https://crates.io/crates/rustc_version) [![Build status](https://github.com/djc/rustc-version-rs/workflows/CI/badge.svg)](https://github.com/djc/rustc-version-rs/actions?query=workflow%3ACI) A library for querying the version of a `rustc` compiler. This can be used by build scripts or other tools dealing with Rust sources to make decisions based on the version of the compiler. Current MSRV is 1.32.0. If this is of interest, also consider looking at these other crates: * [autocfg](https://crates.io/crates/autocfg/), which helps with feature detection instead of depending on compiler versions * [rustversion](https://github.com/dtolnay/rustversion) provides a procedural macro with no other dependencies # Getting Started [rustc-version-rs is available on crates.io](https://crates.io/crates/rustc_version). It is recommended to look there for the newest released version, as well as links to the newest builds of the docs. At the point of the last update of this README, the latest published version could be used like this: Add the following dependency to your Cargo manifest... ```toml [build-dependencies] rustc_version = "0.2" ``` ... and see the [docs](https://docs.rs/rustc_version) for how to use it. # Example ```rust // This could be a cargo build script use rustc_version::{version, version_meta, Channel, Version}; fn main() { // Assert we haven't travelled back in time assert!(version().unwrap().major >= 1); // Set cfg flags depending on release channel match version_meta().unwrap().channel { Channel::Stable => { println!("cargo:rustc-cfg=RUSTC_IS_STABLE"); } Channel::Beta => { println!("cargo:rustc-cfg=RUSTC_IS_BETA"); } Channel::Nightly => { println!("cargo:rustc-cfg=RUSTC_IS_NIGHTLY"); } Channel::Dev => { println!("cargo:rustc-cfg=RUSTC_IS_DEV"); } } // Check for a minimum version if version().unwrap() >= Version::parse("1.4.0").unwrap() { println!("cargo:rustc-cfg=compiler_has_important_bugfix"); } } ``` ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/rusticata-macros/README.md # rusticata-macros [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![Build Status](https://travis-ci.org/rusticata/rusticata-macros.svg?branch=master)](https://travis-ci.org/rusticata/rusticata-macros) [![Github CI](https://github.com/rusticata/rusticata-macros/workflows/Continuous%20integration/badge.svg)](https://github.com/rusticata/rusticata-macros/actions) [![Crates.io Version](https://img.shields.io/crates/v/rusticata-macros.svg)](https://crates.io/crates/rusticata-macros) # Rusticata-macros Helper macros for the [rusticata](https://github.com/rusticata) project. This crate contains some additions to [nom](https://github.com/Geal/nom). For example, the [`combinator::cond_else`] function allows to apply the first parser if the condition is true, and the second if the condition is false: ```rust use rusticata_macros::combinator::cond_else; let r: IResult<_, _, ()> = cond_else( || s.len() > 1, be_u16, map(be_u8, u16::from) )(s); ``` See the documentation for more details and examples. ## Nom versions Different versions of this crate are available, depending on nom version. - `rusticata-macros` 4.x depends on nom 7 - `rusticata-macros` 3.x depends on nom 6 - `rusticata-macros` 2.x depends on nom 5 ## Documentation Crate is documented, do running `cargo doc` will crate the offline documentation. Reference documentation can be found [here](https://docs.rs/rusticata-macros/) ## Changes ### 4.1.0 - Remove macro `slice_fixed` ### 4.0.0 - Upgrade to nom 7 - Remove macros ### 3.0.1 - Add `be_var_u64` and `le_var_u64` ### 3.0.0 - Upgrade to nom 6 ### 2.1.0 - Add common trait `Serialize` for structures serialization ### 2.0.4 - Add function version of most combinators ### 2.0.3 - Add macros `q` (quote) and `align32` ### 2.0.2 - Add `upgrade_error` and `upgrade_error_to` ### 2.0.1 - Add macro `custom_check` - Add macro `flat_take` ### 2.0.0 - Upgrade to nom 5 - Debug types: use newtypes ### 1.1.0 - Add macro `newtype_enum` ### 1.0.0 - Upgrade to nom 4.0 - Warning: this is a breaking change! - Mark `parse_uint24` as deprecated ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/rustversion/README.md Compiler version cfg ==================== [github](https://github.com/dtolnay/rustversion) [crates.io](https://crates.io/crates/rustversion) [docs.rs](https://docs.rs/rustversion) [build status](https://github.com/dtolnay/rustversion/actions?query=branch%3Amaster) This crate provides macros for conditional compilation according to rustc compiler version, analogous to [`#[cfg(...)]`][cfg] and [`#[cfg_attr(...)]`][cfg_attr]. [cfg]: https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute [cfg_attr]: https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute ```toml [dependencies] rustversion = "1.0" ```
    ## Selectors - `#[rustversion::stable]`
    True on any stable compiler. - `#[rustversion::stable(1.34)]`
    True on exactly the specified stable compiler. - `#[rustversion::beta]`
    True on any beta compiler. - `#[rustversion::nightly]`
    True on any nightly compiler or dev build. - `#[rustversion::nightly(2025-01-01)]`
    True on exactly one nightly. - `#[rustversion::since(1.34)]`
    True on that stable release and any later compiler, including beta and nightly. - `#[rustversion::since(2025-01-01)]`
    True on that nightly and all newer ones. - `#[rustversion::before(`version or date`)]`
    Negative of *#[rustversion::since(...)]*. - `#[rustversion::not(`selector`)]`
    Negative of any selector; for example *#[rustversion::not(nightly)]*. - `#[rustversion::any(`selectors...`)]`
    True if any of the comma-separated selectors is true; for example *#[rustversion::any(stable, beta)]*. - `#[rustversion::all(`selectors...`)]`
    True if all of the comma-separated selectors are true; for example *#[rustversion::all(since(1.31), before(1.34))]*. - `#[rustversion::attr(`selector`, `attribute`)]`
    For conditional inclusion of attributes; analogous to `cfg_attr`. - `rustversion::cfg!(`selector`)`
    An expression form of any of the above attributes; for example *if rustversion::cfg!(any(stable, beta)) { ... }*.
    ## Use cases Providing additional trait impls as types are stabilized in the standard library without breaking compatibility with older compilers; in this case Pin\ stabilized in [Rust 1.33][pin]: [pin]: https://blog.rust-lang.org/2019/02/28/Rust-1.33.0.html#pinning ```rust #[rustversion::since(1.33)] use std::pin::Pin; #[rustversion::since(1.33)] impl MyTrait for Pin

    { /* ... */ } ``` Similar but for language features; the ability to control alignment greater than 1 of packed structs was stabilized in [Rust 1.33][packed]. [packed]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1330-2019-02-28 ```rust #[rustversion::attr(before(1.33), repr(packed))] #[rustversion::attr(since(1.33), repr(packed(2)))] struct Six(i16, i32); fn main() { println!("{}", std::mem::align_of::()); } ``` Augmenting code with `const` as const impls are stabilized in the standard library. This use of `const` as an attribute is recognized as a special case by the rustversion::attr macro. ```rust use std::time::Duration; #[rustversion::attr(since(1.32), const)] fn duration_as_days(dur: Duration) -> u64 { dur.as_secs() / 60 / 60 / 24 } ``` Emitting Cargo cfg directives from a build script. Note that this requires listing `rustversion` under `[build-dependencies]` in Cargo.toml, not `[dependencies]`. ```rust // build.rs fn main() { if rustversion::cfg!(since(1.36)) { println!("cargo:rustc-cfg=no_std"); } } ``` ```rust // src/lib.rs #![cfg_attr(no_std, no_std)] #[cfg(no_std)] extern crate alloc; ```
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/ryu/README.md # Ryū [github](https://github.com/dtolnay/ryu) [crates.io](https://crates.io/crates/ryu) [docs.rs](https://docs.rs/ryu) [build status](https://github.com/dtolnay/ryu/actions?query=branch%3Amaster) Pure Rust implementation of Ryū, an algorithm to quickly convert floating point numbers to decimal strings. The PLDI'18 paper [*Ryū: fast float-to-string conversion*][paper] by Ulf Adams includes a complete correctness proof of the algorithm. The paper is available under the creative commons CC-BY-SA license. This Rust implementation is a line-by-line port of Ulf Adams' implementation in C, [https://github.com/ulfjack/ryu][upstream]. *Requirements: this crate supports any compiler version back to rustc 1.36; it uses nothing from the Rust standard library so is usable from no_std crates.* [paper]: https://dl.acm.org/citation.cfm?id=3192369 [upstream]: https://github.com/ulfjack/ryu/tree/77e767f5e056bab96e895072fc21618ecff2f44b ```toml [dependencies] ryu = "1.0" ```
    ## Example ```rust fn main() { let mut buffer = ryu::Buffer::new(); let printed = buffer.format(1.234); assert_eq!(printed, "1.234"); } ```
    ## Performance (lower is better) ![performance](https://raw.githubusercontent.com/dtolnay/ryu/master/performance.png) You can run upstream's benchmarks with: ```console $ git clone https://github.com/ulfjack/ryu c-ryu $ cd c-ryu $ bazel run -c opt //ryu/benchmark:ryu_benchmark ``` And the same benchmark against our implementation with: ```console $ git clone https://github.com/dtolnay/ryu rust-ryu $ cd rust-ryu $ cargo run --example upstream_benchmark --release ``` These benchmarks measure the average time to print a 32-bit float and average time to print a 64-bit float, where the inputs are distributed as uniform random bit patterns 32 and 64 bits wide. The upstream C code, the unsafe direct Rust port, and the safe pretty Rust API all perform the same, taking around 21 nanoseconds to format a 32-bit float and 31 nanoseconds to format a 64-bit float. There is also a Rust-specific benchmark comparing this implementation to the standard library which you can run with: ```console $ cargo bench ``` The benchmark shows Ryū approximately 2-5x faster than the standard library across a range of f32 and f64 inputs. Measurements are in nanoseconds per iteration; smaller is better. ## Formatting This library tends to produce more human-readable output than the standard library's to\_string, which never uses scientific notation. Here are two examples: - *ryu:* 1.23e40, *std:* 12300000000000000000000000000000000000000 - *ryu:* 1.23e-40, *std:* 0.000000000000000000000000000000000000000123 Both libraries print short decimals such as 0.0000123 without scientific notation.
    #### License Licensed under either of Apache License, Version 2.0 or Boost Software License 1.0 at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/semver/README.md semver ====== [github](https://github.com/dtolnay/semver) [crates.io](https://crates.io/crates/semver) [docs.rs](https://docs.rs/semver) [build status](https://github.com/dtolnay/semver/actions?query=branch%3Amaster) A parser and evaluator for Cargo's flavor of Semantic Versioning. Semantic Versioning (see ) is a guideline for how version numbers are assigned and incremented. It is widely followed within the Cargo/crates.io ecosystem for Rust. ```toml [dependencies] semver = "1.0" ``` *Compiler support: requires rustc 1.31+*
    ## Example ```rust use semver::{BuildMetadata, Prerelease, Version, VersionReq}; fn main() { let req = VersionReq::parse(">=1.2.3, <1.8.0").unwrap(); // Check whether this requirement matches version 1.2.3-alpha.1 (no) let version = Version { major: 1, minor: 2, patch: 3, pre: Prerelease::new("alpha.1").unwrap(), build: BuildMetadata::EMPTY, }; assert!(!req.matches(&version)); // Check whether it matches 1.3.0 (yes it does) let version = Version::parse("1.3.0").unwrap(); assert!(req.matches(&version)); } ```
    ## Scope of this crate Besides Cargo, several other package ecosystems and package managers for other languages also use SemVer: RubyGems/Bundler for Ruby, npm for JavaScript, Composer for PHP, CocoaPods for Objective-C... The `semver` crate is specifically intended to implement Cargo's interpretation of Semantic Versioning. Where the various tools differ in their interpretation or implementation of the spec, this crate follows the implementation choices made by Cargo. If you are operating on version numbers from some other package ecosystem, you will want to use a different semver library which is appropriate to that ecosystem. The extent of Cargo's SemVer support is documented in the *[Specifying Dependencies]* chapter of the Cargo reference. [Specifying Dependencies]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/serde/README.md rust/vendor/serde_derive/README.md # Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.31] [![serde_derive msrv]][Rust 1.61] [Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master [actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster [Latest Version]: https://img.shields.io/crates/v/serde.svg [crates.io]: https://crates.io/crates/serde [serde msrv]: https://img.shields.io/crates/msrv/serde.svg?label=serde%20msrv&color=lightgray [serde_derive msrv]: https://img.shields.io/crates/msrv/serde_derive.svg?label=serde_derive%20msrv&color=lightgray [Rust 1.31]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html [Rust 1.61]: https://blog.rust-lang.org/2022/05/19/Rust-1.61.0.html **Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.** --- You may be looking for: - [An overview of Serde](https://serde.rs/) - [Data formats supported by Serde](https://serde.rs/#data-formats) - [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/derive.html) - [Examples](https://serde.rs/examples.html) - [API documentation](https://docs.rs/serde) - [Release notes](https://github.com/serde-rs/serde/releases) ## Serde in action

    Click to show Cargo.toml. Run this code in the playground. ```toml [dependencies] # The core APIs, including the Serialize and Deserialize traits. Always # required when using Serde. The "derive" feature is only required when # using #[derive(Serialize, Deserialize)] to make Serde work with structs # and enums defined in your crate. serde = { version = "1.0", features = ["derive"] } # Each data format lives in its own crate; the sample code below uses JSON # but you may be using a different one. serde_json = "1.0" ```

    ```rust use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug)] struct Point { x: i32, y: i32, } fn main() { let point = Point { x: 1, y: 2 }; // Convert the Point to a JSON string. let serialized = serde_json::to_string(&point).unwrap(); // Prints serialized = {"x":1,"y":2} println!("serialized = {}", serialized); // Convert the JSON string back to a Point. let deserialized: Point = serde_json::from_str(&serialized).unwrap(); // Prints deserialized = Point { x: 1, y: 2 } println!("deserialized = {:?}", deserialized); } ``` ## Getting help Serde is one of the most widely used Rust libraries so any place that Rustaceans congregate will be able to help you out. For chat, consider trying the [#rust-questions] or [#rust-beginners] channels of the unofficial community Discord (invite: ), the [#rust-usage] or [#beginners] channels of the official Rust Project Discord (invite: ), or the [#general][zulip] stream in Zulip. For asynchronous, consider the [\[rust\] tag on StackOverflow][stackoverflow], the [/r/rust] subreddit which has a pinned weekly easy questions post, or the Rust [Discourse forum][discourse]. It's acceptable to file a support issue in this repo but they tend not to get as many eyes as any of the above and may get closed without a response after some time. [#rust-questions]: https://discord.com/channels/273534239310479360/274215136414400513 [#rust-beginners]: https://discord.com/channels/273534239310479360/273541522815713281 [#rust-usage]: https://discord.com/channels/442252698964721669/443150878111694848 [#beginners]: https://discord.com/channels/442252698964721669/448238009733742612 [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general [stackoverflow]: https://stackoverflow.com/questions/tagged/rust [/r/rust]: https://www.reddit.com/r/rust [discourse]: https://users.rust-lang.org
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/serde_json/README.md # Serde JSON   [![Build Status]][actions] [![Latest Version]][crates.io] [![Rustc Version 1.36+]][rustc] [Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/json/ci.yml?branch=master [actions]: https://github.com/serde-rs/json/actions?query=branch%3Amaster [Latest Version]: https://img.shields.io/crates/v/serde_json.svg [crates.io]: https://crates.io/crates/serde\_json [Rustc Version 1.36+]: https://img.shields.io/badge/rustc-1.36+-lightgray.svg [rustc]: https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html **Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.** --- ```toml [dependencies] serde_json = "1.0" ``` You may be looking for: - [JSON API documentation](https://docs.rs/serde_json) - [Serde API documentation](https://docs.rs/serde) - [Detailed documentation about Serde](https://serde.rs/) - [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/derive.html) - [Release notes](https://github.com/serde-rs/json/releases) JSON is a ubiquitous open-standard format that uses human-readable text to transmit data objects consisting of key-value pairs. ```json { "name": "John Doe", "age": 43, "address": { "street": "10 Downing Street", "city": "London" }, "phones": [ "+44 1234567", "+44 2345678" ] } ``` There are three common ways that you might find yourself needing to work with JSON data in Rust. - **As text data.** An unprocessed string of JSON data that you receive on an HTTP endpoint, read from a file, or prepare to send to a remote server. - **As an untyped or loosely typed representation.** Maybe you want to check that some JSON data is valid before passing it on, but without knowing the structure of what it contains. Or you want to do very basic manipulations like insert a key in a particular spot. - **As a strongly typed Rust data structure.** When you expect all or most of your data to conform to a particular structure and want to get real work done without JSON's loosey-goosey nature tripping you up. Serde JSON provides efficient, flexible, safe ways of converting data between each of these representations. ## Operating on untyped JSON values Any valid JSON data can be manipulated in the following recursive enum representation. This data structure is [`serde_json::Value`][value]. ```rust enum Value { Null, Bool(bool), Number(Number), String(String), Array(Vec), Object(Map), } ``` A string of JSON data can be parsed into a `serde_json::Value` by the [`serde_json::from_str`][from_str] function. There is also [`from_slice`][from_slice] for parsing from a byte slice `&[u8]` and [`from_reader`][from_reader] for parsing from any `io::Read` like a File or a TCP stream. ```rust use serde_json::{Result, Value}; fn untyped_example() -> Result<()> { // Some JSON input data as a &str. Maybe this comes from the user. let data = r#" { "name": "John Doe", "age": 43, "phones": [ "+44 1234567", "+44 2345678" ] }"#; // Parse the string of data into serde_json::Value. let v: Value = serde_json::from_str(data)?; // Access parts of the data by indexing with square brackets. println!("Please call {} at the number {}", v["name"], v["phones"][0]); Ok(()) } ``` The result of square bracket indexing like `v["name"]` is a borrow of the data at that index, so the type is `&Value`. A JSON map can be indexed with string keys, while a JSON array can be indexed with integer keys. If the type of the data is not right for the type with which it is being indexed, or if a map does not contain the key being indexed, or if the index into a vector is out of bounds, the returned element is `Value::Null`. When a `Value` is printed, it is printed as a JSON string. So in the code above, the output looks like `Please call "John Doe" at the number "+44 1234567"`. The quotation marks appear because `v["name"]` is a `&Value` containing a JSON string and its JSON representation is `"John Doe"`. Printing as a plain string without quotation marks involves converting from a JSON string to a Rust string with [`as_str()`] or avoiding the use of `Value` as described in the following section. [`as_str()`]: https://docs.rs/serde_json/1/serde_json/enum.Value.html#method.as_str The `Value` representation is sufficient for very basic tasks but can be tedious to work with for anything more significant. Error handling is verbose to implement correctly, for example imagine trying to detect the presence of unrecognized fields in the input data. The compiler is powerless to help you when you make a mistake, for example imagine typoing `v["name"]` as `v["nmae"]` in one of the dozens of places it is used in your code. ## Parsing JSON as strongly typed data structures Serde provides a powerful way of mapping JSON data into Rust data structures largely automatically. ```rust use serde::{Deserialize, Serialize}; use serde_json::Result; #[derive(Serialize, Deserialize)] struct Person { name: String, age: u8, phones: Vec, } fn typed_example() -> Result<()> { // Some JSON input data as a &str. Maybe this comes from the user. let data = r#" { "name": "John Doe", "age": 43, "phones": [ "+44 1234567", "+44 2345678" ] }"#; // Parse the string of data into a Person object. This is exactly the // same function as the one that produced serde_json::Value above, but // now we are asking it for a Person as output. let p: Person = serde_json::from_str(data)?; // Do things just like with any other Rust data structure. println!("Please call {} at the number {}", p.name, p.phones[0]); Ok(()) } ``` This is the same `serde_json::from_str` function as before, but this time we assign the return value to a variable of type `Person` so Serde will automatically interpret the input data as a `Person` and produce informative error messages if the layout does not conform to what a `Person` is expected to look like. Any type that implements Serde's `Deserialize` trait can be deserialized this way. This includes built-in Rust standard library types like `Vec` and `HashMap`, as well as any structs or enums annotated with `#[derive(Deserialize)]`. Once we have `p` of type `Person`, our IDE and the Rust compiler can help us use it correctly like they do for any other Rust code. The IDE can autocomplete field names to prevent typos, which was impossible in the `serde_json::Value` representation. And the Rust compiler can check that when we write `p.phones[0]`, then `p.phones` is guaranteed to be a `Vec` so indexing into it makes sense and produces a `String`. The necessary setup for using Serde's derive macros is explained on the *[Using derive]* page of the Serde site. [Using derive]: https://serde.rs/derive.html ## Constructing JSON values Serde JSON provides a [`json!` macro][macro] to build `serde_json::Value` objects with very natural JSON syntax. ```rust use serde_json::json; fn main() { // The type of `john` is `serde_json::Value` let john = json!({ "name": "John Doe", "age": 43, "phones": [ "+44 1234567", "+44 2345678" ] }); println!("first phone number: {}", john["phones"][0]); // Convert to a string of JSON and print it out println!("{}", john.to_string()); } ``` The `Value::to_string()` function converts a `serde_json::Value` into a `String` of JSON text. One neat thing about the `json!` macro is that variables and expressions can be interpolated directly into the JSON value as you are building it. Serde will check at compile time that the value you are interpolating is able to be represented as JSON. ```rust let full_name = "John Doe"; let age_last_year = 42; // The type of `john` is `serde_json::Value` let john = json!({ "name": full_name, "age": age_last_year + 1, "phones": [ format!("+44 {}", random_phone()) ] }); ``` This is amazingly convenient, but we have the problem we had before with `Value`: the IDE and Rust compiler cannot help us if we get it wrong. Serde JSON provides a better way of serializing strongly-typed data structures into JSON text. ## Creating JSON by serializing data structures A data structure can be converted to a JSON string by [`serde_json::to_string`][to_string]. There is also [`serde_json::to_vec`][to_vec] which serializes to a `Vec` and [`serde_json::to_writer`][to_writer] which serializes to any `io::Write` such as a File or a TCP stream. ```rust use serde::{Deserialize, Serialize}; use serde_json::Result; #[derive(Serialize, Deserialize)] struct Address { street: String, city: String, } fn print_an_address() -> Result<()> { // Some data structure. let address = Address { street: "10 Downing Street".to_owned(), city: "London".to_owned(), }; // Serialize it to a JSON string. let j = serde_json::to_string(&address)?; // Print, write to a file, or send to an HTTP server. println!("{}", j); Ok(()) } ``` Any type that implements Serde's `Serialize` trait can be serialized this way. This includes built-in Rust standard library types like `Vec` and `HashMap`, as well as any structs or enums annotated with `#[derive(Serialize)]`. ## Performance It is fast. You should expect in the ballpark of 500 to 1000 megabytes per second deserialization and 600 to 900 megabytes per second serialization, depending on the characteristics of your data. This is competitive with the fastest C and C++ JSON libraries or even 30% faster for many use cases. Benchmarks live in the [serde-rs/json-benchmark] repo. [serde-rs/json-benchmark]: https://github.com/serde-rs/json-benchmark ## Getting help Serde is one of the most widely used Rust libraries, so any place that Rustaceans congregate will be able to help you out. For chat, consider trying the [#rust-questions] or [#rust-beginners] channels of the unofficial community Discord (invite: ), the [#rust-usage] or [#beginners] channels of the official Rust Project Discord (invite: ), or the [#general][zulip] stream in Zulip. For asynchronous, consider the [\[rust\] tag on StackOverflow][stackoverflow], the [/r/rust] subreddit which has a pinned weekly easy questions post, or the Rust [Discourse forum][discourse]. It's acceptable to file a support issue in this repo, but they tend not to get as many eyes as any of the above and may get closed without a response after some time. [#rust-questions]: https://discord.com/channels/273534239310479360/274215136414400513 [#rust-beginners]: https://discord.com/channels/273534239310479360/273541522815713281 [#rust-usage]: https://discord.com/channels/442252698964721669/443150878111694848 [#beginners]: https://discord.com/channels/442252698964721669/448238009733742612 [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general [stackoverflow]: https://stackoverflow.com/questions/tagged/rust [/r/rust]: https://www.reddit.com/r/rust [discourse]: https://users.rust-lang.org ## No-std support As long as there is a memory allocator, it is possible to use serde_json without the rest of the Rust standard library. Disable the default "std" feature and enable the "alloc" feature: ```toml [dependencies] serde_json = { version = "1.0", default-features = false, features = ["alloc"] } ``` For JSON support in Serde without a memory allocator, please see the [`serde-json-core`] crate. [`serde-json-core`]: https://github.com/rust-embedded-community/serde-json-core [value]: https://docs.rs/serde_json/1/serde_json/value/enum.Value.html [from_str]: https://docs.rs/serde_json/1/serde_json/de/fn.from_str.html [from_slice]: https://docs.rs/serde_json/1/serde_json/de/fn.from_slice.html [from_reader]: https://docs.rs/serde_json/1/serde_json/de/fn.from_reader.html [to_string]: https://docs.rs/serde_json/1/serde_json/ser/fn.to_string.html [to_vec]: https://docs.rs/serde_json/1/serde_json/ser/fn.to_vec.html [to_writer]: https://docs.rs/serde_json/1/serde_json/ser/fn.to_writer.html [macro]: https://docs.rs/serde_json/1/serde_json/macro.json.html
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/sha1/README.md # RustCrypto: SHA-1 [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Pure Rust implementation of the [SHA-1 hash function][1]. [Documentation][docs-link] ## 🚨 Warning: Cryptographically Broken 🚨 The SHA-1 hash function should be considered cryptographically broken and unsuitable for further use in any security critical capacity, as it is [practically vulnerable to chosen-prefix collisions][2]. We provide this crate for legacy interoperability purposes only. ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/sha1.svg [crate-link]: https://crates.io/crates/sha1 [docs-image]: https://docs.rs/sha1/badge.svg [docs-link]: https://docs.rs/sha1/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/sha1/badge.svg?branch=master [build-link]: https://github.com/RustCrypto/hashes/actions?query=workflow%3Asha1 [//]: # (general links) [1]: https://en.wikipedia.org/wiki/SHA-1 [2]: https://sha-mbles.github.io/ ## Files: rust/vendor/sha2/README.md # RustCrypto: SHA-2 [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Pure Rust implementation of the [SHA-2 hash function family][1] including SHA-224, SHA-256, SHA-384, and SHA-512. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/sha2.svg [crate-link]: https://crates.io/crates/sha2 [docs-image]: https://docs.rs/sha2/badge.svg [docs-link]: https://docs.rs/sha2/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/sha2/badge.svg?branch=master [build-link]: https://github.com/RustCrypto/hashes/actions?query=workflow%3Asha2 [//]: # (general links) [1]: https://en.wikipedia.org/wiki/SHA-2 ## Files: rust/vendor/sharded-slab/README.md # sharded-slab A lock-free concurrent slab. [![Crates.io][crates-badge]][crates-url] [![Documentation][docs-badge]][docs-url] [![CI Status][ci-badge]][ci-url] [![GitHub License][license-badge]][license] ![maintenance status][maint-badge] [crates-badge]: https://img.shields.io/crates/v/sharded-slab.svg [crates-url]: https://crates.io/crates/sharded-slab [docs-badge]: https://docs.rs/sharded-slab/badge.svg [docs-url]: https://docs.rs/sharded-slab/latest [ci-badge]: https://github.com/hawkw/sharded-slab/workflows/CI/badge.svg [ci-url]: https://github.com/hawkw/sharded-slab/actions?workflow=CI [license-badge]: https://img.shields.io/crates/l/sharded-slab [license]: LICENSE [maint-badge]: https://img.shields.io/badge/maintenance-experimental-blue.svg Slabs provide pre-allocated storage for many instances of a single data type. When a large number of values of a single type are required, this can be more efficient than allocating each item individually. Since the allocated items are the same size, memory fragmentation is reduced, and creating and removing new items can be very cheap. This crate implements a lock-free concurrent slab, indexed by `usize`s. **Note**: This crate is currently experimental. Please feel free to use it in your projects, but bear in mind that there's still plenty of room for optimization, and there may still be some lurking bugs. ## Usage First, add this to your `Cargo.toml`: ```toml sharded-slab = "0.1.7" ``` This crate provides two types, [`Slab`] and [`Pool`], which provide slightly different APIs for using a sharded slab. [`Slab`] implements a slab for _storing_ small types, sharing them between threads, and accessing them by index. New entries are allocated by [inserting] data, moving it in by value. Similarly, entries may be deallocated by [taking] from the slab, moving the value out. This API is similar to a `Vec>`, but allowing lock-free concurrent insertion and removal. In contrast, the [`Pool`] type provides an [object pool] style API for _reusing storage_. Rather than constructing values and moving them into the pool, as with [`Slab`], [allocating an entry][create] from the pool takes a closure that's provided with a mutable reference to initialize the entry in place. When entries are deallocated, they are [cleared] in place. Types which own a heap allocation can be cleared by dropping any _data_ they store, but retaining any previously-allocated capacity. This means that a [`Pool`] may be used to reuse a set of existing heap allocations, reducing allocator load. [`Slab`]: https://docs.rs/sharded-slab/0.1.4/sharded_slab/struct.Slab.html [inserting]: https://docs.rs/sharded-slab/0.1.4/sharded_slab/struct.Slab.html#method.insert [taking]: https://docs.rs/sharded-slab/0.1.4/sharded_slab/struct.Slab.html#method.take [`Pool`]: https://docs.rs/sharded-slab/0.1.4/sharded_slab/struct.Pool.html [create]: https://docs.rs/sharded-slab/0.1.4/sharded_slab/struct.Pool.html#method.create [cleared]: https://docs.rs/sharded-slab/0.1.4/sharded_slab/trait.Clear.html [object pool]: https://en.wikipedia.org/wiki/Object_pool_pattern ### Examples Inserting an item into the slab, returning an index: ```rust use sharded_slab::Slab; let slab = Slab::new(); let key = slab.insert("hello world").unwrap(); assert_eq!(slab.get(key).unwrap(), "hello world"); ``` To share a slab across threads, it may be wrapped in an `Arc`: ```rust use sharded_slab::Slab; use std::sync::Arc; let slab = Arc::new(Slab::new()); let slab2 = slab.clone(); let thread2 = std::thread::spawn(move || { let key = slab2.insert("hello from thread two").unwrap(); assert_eq!(slab2.get(key).unwrap(), "hello from thread two"); key }); let key1 = slab.insert("hello from thread one").unwrap(); assert_eq!(slab.get(key1).unwrap(), "hello from thread one"); // Wait for thread 2 to complete. let key2 = thread2.join().unwrap(); // The item inserted by thread 2 remains in the slab. assert_eq!(slab.get(key2).unwrap(), "hello from thread two"); ``` If items in the slab must be mutated, a `Mutex` or `RwLock` may be used for each item, providing granular locking of items rather than of the slab: ```rust use sharded_slab::Slab; use std::sync::{Arc, Mutex}; let slab = Arc::new(Slab::new()); let key = slab.insert(Mutex::new(String::from("hello world"))).unwrap(); let slab2 = slab.clone(); let thread2 = std::thread::spawn(move || { let hello = slab2.get(key).expect("item missing"); let mut hello = hello.lock().expect("mutex poisoned"); *hello = String::from("hello everyone!"); }); thread2.join().unwrap(); let hello = slab.get(key).expect("item missing"); let mut hello = hello.lock().expect("mutex poisoned"); assert_eq!(hello.as_str(), "hello everyone!"); ``` ## Comparison with Similar Crates - [`slab`][slab crate]: Carl Lerche's `slab` crate provides a slab implementation with a similar API, implemented by storing all data in a single vector. Unlike `sharded-slab`, inserting and removing elements from the slab requires mutable access. This means that if the slab is accessed concurrently by multiple threads, it is necessary for it to be protected by a `Mutex` or `RwLock`. Items may not be inserted or removed (or accessed, if a `Mutex` is used) concurrently, even when they are unrelated. In many cases, the lock can become a significant bottleneck. On the other hand, `sharded-slab` allows separate indices in the slab to be accessed, inserted, and removed concurrently without requiring a global lock. Therefore, when the slab is shared across multiple threads, this crate offers significantly better performance than `slab`. However, the lock free slab introduces some additional constant-factor overhead. This means that in use-cases where a slab is _not_ shared by multiple threads and locking is not required, `sharded-slab` will likely offer slightly worse performance. In summary: `sharded-slab` offers significantly improved performance in concurrent use-cases, while `slab` should be preferred in single-threaded use-cases. [slab crate]: https://crates.io/crates/slab ## Safety and Correctness Most implementations of lock-free data structures in Rust require some amount of unsafe code, and this crate is not an exception. In order to catch potential bugs in this unsafe code, we make use of [`loom`], a permutation-testing tool for concurrent Rust programs. All `unsafe` blocks this crate occur in accesses to `loom` `UnsafeCell`s. This means that when those accesses occur in this crate's tests, `loom` will assert that they are valid under the C11 memory model across multiple permutations of concurrent executions of those tests. In order to guard against the [ABA problem][aba], this crate makes use of _generational indices_. Each slot in the slab tracks a generation counter which is incremented every time a value is inserted into that slot, and the indices returned by `Slab::insert` include the generation of the slot when the value was inserted, packed into the high-order bits of the index. This ensures that if a value is inserted, removed, and a new value is inserted into the same slot in the slab, the key returned by the first call to `insert` will not map to the new value. Since a fixed number of bits are set aside to use for storing the generation counter, the counter will wrap around after being incremented a number of times. To avoid situations where a returned index lives long enough to see the generation counter wrap around to the same value, it is good to be fairly generous when configuring the allocation of index bits. [`loom`]: https://crates.io/crates/loom [aba]: https://en.wikipedia.org/wiki/ABA_problem ## Performance These graphs were produced by [benchmarks] of the sharded slab implementation, using the [`criterion`] crate. The first shows the results of a benchmark where an increasing number of items are inserted and then removed into a slab concurrently by five threads. It compares the performance of the sharded slab implementation with a `RwLock`: Screen Shot 2019-10-01 at 5 09 49 PM The second graph shows the results of a benchmark where an increasing number of items are inserted and then removed by a _single_ thread. It compares the performance of the sharded slab implementation with an `RwLock` and a `mut slab::Slab`. Screen Shot 2019-10-01 at 5 13 45 PM These benchmarks demonstrate that, while the sharded approach introduces a small constant-factor overhead, it offers significantly better performance across concurrent accesses. [benchmarks]: https://github.com/hawkw/sharded-slab/blob/master/benches/bench.rs [`criterion`]: https://crates.io/crates/criterion ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/shlex/README.md [![ci badge]][ci link] [![crates.io badge]][crates.io link] [![docs.rs badge]][docs.rs link] [crates.io badge]: https://img.shields.io/crates/v/shlex.svg?style=flat-square [crates.io link]: https://crates.io/crates/shlex [docs.rs badge]: https://img.shields.io/badge/docs-online-dddddd.svg?style=flat-square [docs.rs link]: https://docs.rs/shlex [ci badge]: https://img.shields.io/github/actions/workflow/status/comex/rust-shlex/test.yml?branch=master&style=flat-square [ci link]: https://github.com/comex/rust-shlex/actions Same idea as (but implementation not directly based on) the Python shlex module. However, this implementation does not support any of the Python module's customization because it makes parsing slower and is fairly useless. You only get the default settings of shlex.split, which mimic the POSIX shell: This implementation also deviates from the Python version in not treating \r specially, which I believe is more compliant. This crate can be used on either normal Rust strings, or on byte strings with the `bytes` module. The algorithms used are oblivious to UTF-8 high bytes, so internally they all work on bytes directly as a micro-optimization. Disabling the `std` feature (which is enabled by default) will allow the crate to work in `no_std` environments, where the `alloc` crate, and a global allocator, are available. # LICENSE The source code in this repository is Licensed under either of - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) - MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/siphasher/COPYING Copyright 2012-2016 The Rust Project Developers. Copyright 2016-2023 Frank Denis. Licensed under the Apache License, Version 2.0 or the MIT license , at your option. ## Files: rust/vendor/slab/README.md # Slab Pre-allocated storage for a uniform data type. [![Crates.io][crates-badge]][crates-url] [![Build Status][ci-badge]][ci-url] [crates-badge]: https://img.shields.io/crates/v/slab [crates-url]: https://crates.io/crates/slab [ci-badge]: https://img.shields.io/github/actions/workflow/status/tokio-rs/slab/ci.yml?branch=master [ci-url]: https://github.com/tokio-rs/slab/actions [Documentation](https://docs.rs/slab) ## Usage To use `slab`, first add this to your `Cargo.toml`: ```toml [dependencies] slab = "0.4" ``` Next, add this to your crate: ```rust use slab::Slab; let mut slab = Slab::new(); let hello = slab.insert("hello"); let world = slab.insert("world"); assert_eq!(slab[hello], "hello"); assert_eq!(slab[world], "world"); slab[world] = "earth"; assert_eq!(slab[world], "earth"); ``` See [documentation](https://docs.rs/slab) for more details. ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in `slab` by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/snmp-parser/README.md [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![Build Status](https://travis-ci.org/rusticata/snmp-parser.svg?branch=master)](https://travis-ci.org/rusticata/snmp-parser) [![Crates.io Version](https://img.shields.io/crates/v/snmp-parser.svg)](https://crates.io/crates/snmp-parser) # SNMP Parser A SNMP parser, implemented with the [nom](https://github.com/Geal/nom) parser combinator framework. The goal of this parser is to implement SNMP messages analysis, for example to use rules from a network IDS. To read a message, different functions must be used depending on the expected message version. The main functions for parsing are [`parse_snmp_v1`](https://docs.rs/snmp-parser/latest/snmp_parser/snmp/fn.parse_snmp_v1.html), [`parse_snmp_v2c`](https://docs.rs/snmp-parser/latest/snmp_parser/snmp/fn.parse_snmp_v2c.html) and [`parse_snmp_v3`](https://docs.rs/snmp-parser/latest/snmp_parser/snmpv3/fn.parse_snmp_v3.html). If you don't know the version of the message and want to parse a generic SNMP message, use the [`parse_snmp_generic_message`](https://docs.rs/snmp-parser/latest/snmp_parser/fn.parse_snmp_generic_message.html) function. The code is available on [Github](https://github.com/rusticata/snmp-parser) and is part of the [Rusticata](https://github.com/rusticata) project. ## Changes ### 0.10.0 - Update asn1-rs to 0.6 ### 0.9.0 - Convert to asn1-rs - Set MSRV to 1.57 ### 0.8.0 - Upgrade to nom 7 / der-parser 6 ### 0.7.0 - Upgrade to nom 6 / der-parser 5 ### 0.6.0 - Upgrade to der-parser 4 ### 0.5.2 - Use `parse_ber_u32` from der-parser crate ### 0.5.1 - Fix parsing: use BER parsing so DER constraints are not applied ### 0.5.0 - Upgrade to nom 5 and der-parser 3 ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/subtle/LICENSE Copyright (c) 2016-2017 Isis Agora Lovecruft, Henry de Valence. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: rust/vendor/syn/README.md Parser for Rust source code =========================== [github](https://github.com/dtolnay/syn) [crates.io](https://crates.io/crates/syn) [docs.rs](https://docs.rs/syn) [build status](https://github.com/dtolnay/syn/actions?query=branch%3Amaster) Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree of Rust source code. Currently this library is geared toward use in Rust procedural macros, but contains some APIs that may be useful more generally. - **Data structures** — Syn provides a complete syntax tree that can represent any valid Rust source code. The syntax tree is rooted at [`syn::File`] which represents a full source file, but there are other entry points that may be useful to procedural macros including [`syn::Item`], [`syn::Expr`] and [`syn::Type`]. - **Derives** — Of particular interest to derive macros is [`syn::DeriveInput`] which is any of the three legal input items to a derive macro. An example below shows using this type in a library that can derive implementations of a user-defined trait. - **Parsing** — Parsing in Syn is built around [parser functions] with the signature `fn(ParseStream) -> Result`. Every syntax tree node defined by Syn is individually parsable and may be used as a building block for custom syntaxes, or you may dream up your own brand new syntax without involving any of our syntax tree types. - **Location information** — Every token parsed by Syn is associated with a `Span` that tracks line and column information back to the source of that token. These spans allow a procedural macro to display detailed error messages pointing to all the right places in the user's code. There is an example of this below. - **Feature flags** — Functionality is aggressively feature gated so your procedural macros enable only what they need, and do not pay in compile time for all the rest. [`syn::File`]: https://docs.rs/syn/2.0/syn/struct.File.html [`syn::Item`]: https://docs.rs/syn/2.0/syn/enum.Item.html [`syn::Expr`]: https://docs.rs/syn/2.0/syn/enum.Expr.html [`syn::Type`]: https://docs.rs/syn/2.0/syn/enum.Type.html [`syn::DeriveInput`]: https://docs.rs/syn/2.0/syn/struct.DeriveInput.html [parser functions]: https://docs.rs/syn/2.0/syn/parse/index.html *Version requirement: Syn supports rustc 1.61 and up.* [*Release notes*](https://github.com/dtolnay/syn/releases)
    ## Resources The best way to learn about procedural macros is by writing some. Consider working through [this procedural macro workshop][workshop] to get familiar with the different types of procedural macros. The workshop contains relevant links into the Syn documentation as you work through each project. [workshop]: https://github.com/dtolnay/proc-macro-workshop
    ## Example of a derive macro The canonical derive macro using Syn looks like this. We write an ordinary Rust function tagged with a `proc_macro_derive` attribute and the name of the trait we are deriving. Any time that derive appears in the user's code, the Rust compiler passes their data structure as tokens into our macro. We get to execute arbitrary Rust code to figure out what to do with those tokens, then hand some tokens back to the compiler to compile into the user's crate. [`TokenStream`]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html ```toml [dependencies] syn = "2.0" quote = "1.0" [lib] proc-macro = true ``` ```rust use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, DeriveInput}; #[proc_macro_derive(MyMacro)] pub fn my_macro(input: TokenStream) -> TokenStream { // Parse the input tokens into a syntax tree let input = parse_macro_input!(input as DeriveInput); // Build the output, possibly using quasi-quotation let expanded = quote! { // ... }; // Hand the output tokens back to the compiler TokenStream::from(expanded) } ``` The [`heapsize`] example directory shows a complete working implementation of a derive macro. The example derives a `HeapSize` trait which computes an estimate of the amount of heap memory owned by a value. [`heapsize`]: examples/heapsize ```rust pub trait HeapSize { /// Total number of bytes of heap memory owned by `self`. fn heap_size_of_children(&self) -> usize; } ``` The derive macro allows users to write `#[derive(HeapSize)]` on data structures in their program. ```rust #[derive(HeapSize)] struct Demo<'a, T: ?Sized> { a: Box, b: u8, c: &'a str, d: String, } ```
    ## Spans and error reporting The token-based procedural macro API provides great control over where the compiler's error messages are displayed in user code. Consider the error the user sees if one of their field types does not implement `HeapSize`. ```rust #[derive(HeapSize)] struct Broken { ok: String, bad: std::thread::Thread, } ``` By tracking span information all the way through the expansion of a procedural macro as shown in the `heapsize` example, token-based macros in Syn are able to trigger errors that directly pinpoint the source of the problem. ```console error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied --> src/main.rs:7:5 | 7 | bad: std::thread::Thread, | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `std::thread::Thread` ```
    ## Parsing a custom syntax The [`lazy-static`] example directory shows the implementation of a `functionlike!(...)` procedural macro in which the input tokens are parsed using Syn's parsing API. [`lazy-static`]: examples/lazy-static The example reimplements the popular `lazy_static` crate from crates.io as a procedural macro. ```rust lazy_static! { static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap(); } ``` The implementation shows how to trigger custom warnings and error messages on the macro input. ```console warning: come on, pick a more creative name --> src/main.rs:10:16 | 10 | static ref FOO: String = "lazy_static".to_owned(); | ^^^ ```
    ## Testing When testing macros, we often care not just that the macro can be used successfully but also that when the macro is provided with invalid input it produces maximally helpful error messages. Consider using the [`trybuild`] crate to write tests for errors that are emitted by your macro or errors detected by the Rust compiler in the expanded code following misuse of the macro. Such tests help avoid regressions from later refactors that mistakenly make an error no longer trigger or be less helpful than it used to be. [`trybuild`]: https://github.com/dtolnay/trybuild
    ## Debugging When developing a procedural macro it can be helpful to look at what the generated code looks like. Use `cargo rustc -- -Zunstable-options --pretty=expanded` or the [`cargo expand`] subcommand. [`cargo expand`]: https://github.com/dtolnay/cargo-expand To show the expanded code for some crate that uses your procedural macro, run `cargo expand` from that crate. To show the expanded code for one of your own test cases, run `cargo expand --test the_test_case` where the last argument is the name of the test file without the `.rs` extension. This write-up by Brandon W Maister discusses debugging in more detail: [Debugging Rust's new Custom Derive system][debugging]. [debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/
    ## Optional features Syn puts a lot of functionality behind optional features in order to optimize compile time for the most common use cases. The following features are available. - **`derive`** *(enabled by default)* — Data structures for representing the possible input to a derive macro, including structs and enums and types. - **`full`** — Data structures for representing the syntax tree of all valid Rust source code, including items and expressions. - **`parsing`** *(enabled by default)* — Ability to parse input tokens into a syntax tree node of a chosen type. - **`printing`** *(enabled by default)* — Ability to print a syntax tree node as tokens of Rust source code. - **`visit`** — Trait for traversing a syntax tree. - **`visit-mut`** — Trait for traversing and mutating in place a syntax tree. - **`fold`** — Trait for transforming an owned syntax tree. - **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree types. - **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree types. - **`proc-macro`** *(enabled by default)* — Runtime dependency on the dynamic library libproc_macro from rustc toolchain.
    ## Proc macro shim Syn operates on the token representation provided by the [proc-macro2] crate from crates.io rather than using the compiler's built in proc-macro crate directly. This enables code using Syn to execute outside of the context of a procedural macro, such as in unit tests or build.rs, and we avoid needing incompatible ecosystems for proc macros vs non-macro use cases. In general all of your code should be written against proc-macro2 rather than proc-macro. The one exception is in the signatures of procedural macro entry points, which are required by the language to use `proc_macro::TokenStream`. The proc-macro2 crate will automatically detect and use the compiler's data structures when a procedural macro is active. [proc-macro2]: https://docs.rs/proc-macro2/1.0/proc_macro2/
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/syn-1.0.109/README.md Parser for Rust source code =========================== [github](https://github.com/dtolnay/syn) [crates.io](https://crates.io/crates/syn) [docs.rs](https://docs.rs/syn) [build status](https://github.com/dtolnay/syn/actions?query=branch%3Amaster) Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree of Rust source code. Currently this library is geared toward use in Rust procedural macros, but contains some APIs that may be useful more generally. - **Data structures** — Syn provides a complete syntax tree that can represent any valid Rust source code. The syntax tree is rooted at [`syn::File`] which represents a full source file, but there are other entry points that may be useful to procedural macros including [`syn::Item`], [`syn::Expr`] and [`syn::Type`]. - **Derives** — Of particular interest to derive macros is [`syn::DeriveInput`] which is any of the three legal input items to a derive macro. An example below shows using this type in a library that can derive implementations of a user-defined trait. - **Parsing** — Parsing in Syn is built around [parser functions] with the signature `fn(ParseStream) -> Result`. Every syntax tree node defined by Syn is individually parsable and may be used as a building block for custom syntaxes, or you may dream up your own brand new syntax without involving any of our syntax tree types. - **Location information** — Every token parsed by Syn is associated with a `Span` that tracks line and column information back to the source of that token. These spans allow a procedural macro to display detailed error messages pointing to all the right places in the user's code. There is an example of this below. - **Feature flags** — Functionality is aggressively feature gated so your procedural macros enable only what they need, and do not pay in compile time for all the rest. [`syn::File`]: https://docs.rs/syn/1.0/syn/struct.File.html [`syn::Item`]: https://docs.rs/syn/1.0/syn/enum.Item.html [`syn::Expr`]: https://docs.rs/syn/1.0/syn/enum.Expr.html [`syn::Type`]: https://docs.rs/syn/1.0/syn/enum.Type.html [`syn::DeriveInput`]: https://docs.rs/syn/1.0/syn/struct.DeriveInput.html [parser functions]: https://docs.rs/syn/1.0/syn/parse/index.html *Version requirement: Syn supports rustc 1.31 and up.* [*Release notes*](https://github.com/dtolnay/syn/releases)
    ## Resources The best way to learn about procedural macros is by writing some. Consider working through [this procedural macro workshop][workshop] to get familiar with the different types of procedural macros. The workshop contains relevant links into the Syn documentation as you work through each project. [workshop]: https://github.com/dtolnay/proc-macro-workshop
    ## Example of a derive macro The canonical derive macro using Syn looks like this. We write an ordinary Rust function tagged with a `proc_macro_derive` attribute and the name of the trait we are deriving. Any time that derive appears in the user's code, the Rust compiler passes their data structure as tokens into our macro. We get to execute arbitrary Rust code to figure out what to do with those tokens, then hand some tokens back to the compiler to compile into the user's crate. [`TokenStream`]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html ```toml [dependencies] syn = "1.0" quote = "1.0" [lib] proc-macro = true ``` ```rust use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, DeriveInput}; #[proc_macro_derive(MyMacro)] pub fn my_macro(input: TokenStream) -> TokenStream { // Parse the input tokens into a syntax tree let input = parse_macro_input!(input as DeriveInput); // Build the output, possibly using quasi-quotation let expanded = quote! { // ... }; // Hand the output tokens back to the compiler TokenStream::from(expanded) } ``` The [`heapsize`] example directory shows a complete working implementation of a derive macro. It works on any Rust compiler 1.31+. The example derives a `HeapSize` trait which computes an estimate of the amount of heap memory owned by a value. [`heapsize`]: examples/heapsize ```rust pub trait HeapSize { /// Total number of bytes of heap memory owned by `self`. fn heap_size_of_children(&self) -> usize; } ``` The derive macro allows users to write `#[derive(HeapSize)]` on data structures in their program. ```rust #[derive(HeapSize)] struct Demo<'a, T: ?Sized> { a: Box, b: u8, c: &'a str, d: String, } ```
    ## Spans and error reporting The token-based procedural macro API provides great control over where the compiler's error messages are displayed in user code. Consider the error the user sees if one of their field types does not implement `HeapSize`. ```rust #[derive(HeapSize)] struct Broken { ok: String, bad: std::thread::Thread, } ``` By tracking span information all the way through the expansion of a procedural macro as shown in the `heapsize` example, token-based macros in Syn are able to trigger errors that directly pinpoint the source of the problem. ```console error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied --> src/main.rs:7:5 | 7 | bad: std::thread::Thread, | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `std::thread::Thread` ```
    ## Parsing a custom syntax The [`lazy-static`] example directory shows the implementation of a `functionlike!(...)` procedural macro in which the input tokens are parsed using Syn's parsing API. [`lazy-static`]: examples/lazy-static The example reimplements the popular `lazy_static` crate from crates.io as a procedural macro. ```rust lazy_static! { static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap(); } ``` The implementation shows how to trigger custom warnings and error messages on the macro input. ```console warning: come on, pick a more creative name --> src/main.rs:10:16 | 10 | static ref FOO: String = "lazy_static".to_owned(); | ^^^ ```
    ## Testing When testing macros, we often care not just that the macro can be used successfully but also that when the macro is provided with invalid input it produces maximally helpful error messages. Consider using the [`trybuild`] crate to write tests for errors that are emitted by your macro or errors detected by the Rust compiler in the expanded code following misuse of the macro. Such tests help avoid regressions from later refactors that mistakenly make an error no longer trigger or be less helpful than it used to be. [`trybuild`]: https://github.com/dtolnay/trybuild
    ## Debugging When developing a procedural macro it can be helpful to look at what the generated code looks like. Use `cargo rustc -- -Zunstable-options --pretty=expanded` or the [`cargo expand`] subcommand. [`cargo expand`]: https://github.com/dtolnay/cargo-expand To show the expanded code for some crate that uses your procedural macro, run `cargo expand` from that crate. To show the expanded code for one of your own test cases, run `cargo expand --test the_test_case` where the last argument is the name of the test file without the `.rs` extension. This write-up by Brandon W Maister discusses debugging in more detail: [Debugging Rust's new Custom Derive system][debugging]. [debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/
    ## Optional features Syn puts a lot of functionality behind optional features in order to optimize compile time for the most common use cases. The following features are available. - **`derive`** *(enabled by default)* — Data structures for representing the possible input to a derive macro, including structs and enums and types. - **`full`** — Data structures for representing the syntax tree of all valid Rust source code, including items and expressions. - **`parsing`** *(enabled by default)* — Ability to parse input tokens into a syntax tree node of a chosen type. - **`printing`** *(enabled by default)* — Ability to print a syntax tree node as tokens of Rust source code. - **`visit`** — Trait for traversing a syntax tree. - **`visit-mut`** — Trait for traversing and mutating in place a syntax tree. - **`fold`** — Trait for transforming an owned syntax tree. - **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree types. - **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree types. - **`proc-macro`** *(enabled by default)* — Runtime dependency on the dynamic library libproc_macro from rustc toolchain.
    ## Proc macro shim Syn operates on the token representation provided by the [proc-macro2] crate from crates.io rather than using the compiler's built in proc-macro crate directly. This enables code using Syn to execute outside of the context of a procedural macro, such as in unit tests or build.rs, and we avoid needing incompatible ecosystems for proc macros vs non-macro use cases. In general all of your code should be written against proc-macro2 rather than proc-macro. The one exception is in the signatures of procedural macro entry points, which are required by the language to use `proc_macro::TokenStream`. The proc-macro2 crate will automatically detect and use the compiler's data structures when a procedural macro is active. [proc-macro2]: https://docs.rs/proc-macro2/1.0/proc_macro2/
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/test-case-core/README.md rust/vendor/test-case-macros/README.md rust/vendor/test-case/README.md [![Crates.io](https://img.shields.io/crates/v/test-case.svg)](https://crates.io/crates/test-case) [![Crates.io](https://img.shields.io/crates/d/test-case.svg)](https://crates.io/crates/test-case) [![Docs.rs](https://docs.rs/test-case/badge.svg)](https://docs.rs/test-case) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/rust-lang/docs.rs/master/LICENSE) [![Build Status](https://github.com/frondeus/test-case/workflows/Test/badge.svg)](https://github.com/frondeus/test-case/actions) ![Maintenance](https://img.shields.io/badge/maintenance-activly--developed-brightgreen.svg) # Test Case ## Overview `test_case` crate provides procedural macro attribute that generates parametrized test instances. ## Getting Started Crate has to be added as a dependency to `Cargo.toml`: ```toml [dev-dependencies] test-case = "*" ``` and imported to the scope of a block where it's being called (since attribute name collides with rust's built-in `custom_test_frameworks`) via: ```rust use test_case::test_case; ``` ## Example usage: ```rust #[cfg(test)] mod tests { use test_case::test_case; #[test_case(-2, -4 ; "when both operands are negative")] #[test_case(2, 4 ; "when both operands are positive")] #[test_case(4, 2 ; "when operands are swapped")] fn multiplication_tests(x: i8, y: i8) { let actual = (x * y).abs(); assert_eq!(8, actual) } } ``` Output from `cargo test` for this example: ```sh $ cargo test running 4 tests test tests::multiplication_tests::when_both_operands_are_negative ... ok test tests::multiplication_tests::when_both_operands_are_positive ... ok test tests::multiplication_tests::when_operands_are_swapped ... ok test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ``` ### Test Matrix The `#[test_matrix(...)]` macro allows generating multiple test cases from the Cartesian product of one or more possible values for each test function argument. The number of arguments to the `test_matrix` macro must be the same as the number of arguments to the test function. Each macro argument can be: 1. A list in array (`[x, y, ...]`) or tuple (`(x, y, ...)`) syntax. The values can be any valid [expression](https://doc.rust-lang.org/reference/expressions.html). 2. A closed numeric range expression (e.g. `0..100` or `1..=99`), which will generate argument values for all integers in the range. 3. A single expression, which can be used to keep one argument constant while varying the other test function arguments using a list or range. #### Example usage: ```rust #[cfg(test)] mod tests { use test_case::test_matrix; #[test_matrix( [-2, 2], [-4, 4] )] fn multiplication_tests(x: i8, y: i8) { let actual = (x * y).abs(); assert_eq!(8, actual) } } ``` ## MSRV Policy Starting with version 3.0 and up `test-case` introduces policy of only supporting latest stable Rust. These changes may happen overnight, so if your stack is lagging behind current stable release, it may be best to consider locking `test-case` version with `=` in your `Cargo.toml`. ## Documentation Most up to date documentation is available in our [wiki](https://github.com/frondeus/test-case/wiki). # License Licensed under of MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) # Contributing Project roadmap is available at [link](https://github.com/frondeus/test-case/issues/74). All contributions are welcome. Recommended tools: * `cargo readme` - to regenerate README.md based on template and lib.rs comments * `cargo insta` - to review test snapshots * `cargo edit` - to add/remove dependencies * `cargo fmt` - to format code * `cargo clippy` - for all insights and tips * `cargo fix` - for fixing warnings ## Files: rust/vendor/thiserror/README.md derive(Error) ============= [github](https://github.com/dtolnay/thiserror) [crates.io](https://crates.io/crates/thiserror) [docs.rs](https://docs.rs/thiserror) [build status](https://github.com/dtolnay/thiserror/actions?query=branch%3Amaster) This library provides a convenient derive macro for the standard library's [`std::error::Error`] trait. [`std::error::Error`]: https://doc.rust-lang.org/std/error/trait.Error.html ```toml [dependencies] thiserror = "2" ``` *Compiler support: requires rustc 1.61+*
    ## Example ```rust use thiserror::Error; #[derive(Error, Debug)] pub enum DataStoreError { #[error("data store disconnected")] Disconnect(#[from] io::Error), #[error("the data for key `{0}` is not available")] Redaction(String), #[error("invalid header (expected {expected:?}, found {found:?})")] InvalidHeader { expected: String, found: String, }, #[error("unknown data store error")] Unknown, } ```
    ## Details - Thiserror deliberately does not appear in your public API. You get the same thing as if you had written an implementation of `std::error::Error` by hand, and switching from handwritten impls to thiserror or vice versa is not a breaking change. - Errors may be enums, structs with named fields, tuple structs, or unit structs. - A `Display` impl is generated for your error if you provide `#[error("...")]` messages on the struct or each variant of your enum, as shown above in the example. The messages support a shorthand for interpolating fields from the error. - `#[error("{var}")]` ⟶ `write!("{}", self.var)` - `#[error("{0}")]` ⟶ `write!("{}", self.0)` - `#[error("{var:?}")]` ⟶ `write!("{:?}", self.var)` - `#[error("{0:?}")]` ⟶ `write!("{:?}", self.0)` These shorthands can be used together with any additional format args, which may be arbitrary expressions. For example: ```rust #[derive(Error, Debug)] pub enum Error { #[error("invalid rdo_lookahead_frames {0} (expected < {max})", max = i32::MAX)] InvalidLookahead(u32), } ``` If one of the additional expression arguments needs to refer to a field of the struct or enum, then refer to named fields as `.var` and tuple fields as `.0`. ```rust #[derive(Error, Debug)] pub enum Error { #[error("first letter must be lowercase but was {:?}", first_char(.0))] WrongCase(String), #[error("invalid index {idx}, expected at least {} and at most {}", .limits.lo, .limits.hi)] OutOfBounds { idx: usize, limits: Limits }, } ``` - A `From` impl is generated for each variant that contains a `#[from]` attribute. The variant using `#[from]` must not contain any other fields beyond the source error (and possibly a backtrace — see below). Usually `#[from]` fields are unnamed, but `#[from]` is allowed on a named field too. ```rust #[derive(Error, Debug)] pub enum MyError { Io(#[from] io::Error), Glob(#[from] globset::Error), } ``` - The Error trait's `source()` method is implemented to return whichever field has a `#[source]` attribute or is named `source`, if any. This is for identifying the underlying lower level error that caused your error. The `#[from]` attribute always implies that the same field is `#[source]`, so you don't ever need to specify both attributes. Any error type that implements `std::error::Error` or dereferences to `dyn std::error::Error` will work as a source. ```rust #[derive(Error, Debug)] pub struct MyError { msg: String, #[source] // optional if field name is `source` source: anyhow::Error, } ``` - The Error trait's `provide()` method is implemented to provide whichever field has a type named `Backtrace`, if any, as a `std::backtrace::Backtrace`. Using `Backtrace` in errors requires a nightly compiler with Rust version 1.73 or newer. ```rust use std::backtrace::Backtrace; #[derive(Error, Debug)] pub struct MyError { msg: String, backtrace: Backtrace, // automatically detected } ``` - If a field is both a source (named `source`, or has `#[source]` or `#[from]` attribute) *and* is marked `#[backtrace]`, then the Error trait's `provide()` method is forwarded to the source's `provide` so that both layers of the error share the same backtrace. The `#[backtrace]` attribute requires a nightly compiler with Rust version 1.73 or newer. ```rust #[derive(Error, Debug)] pub enum MyError { Io { #[backtrace] source: io::Error, }, } ``` - For variants that use `#[from]` and also contain a `Backtrace` field, a backtrace is captured from within the `From` impl. ```rust #[derive(Error, Debug)] pub enum MyError { Io { #[from] source: io::Error, backtrace: Backtrace, }, } ``` - Errors may use `error(transparent)` to forward the source and Display methods straight through to an underlying error without adding an additional message. This would be appropriate for enums that need an "anything else" variant. ```rust #[derive(Error, Debug)] pub enum MyError { ... #[error(transparent)] Other(#[from] anyhow::Error), // source and Display delegate to anyhow::Error } ``` Another use case is hiding implementation details of an error representation behind an opaque error type, so that the representation is able to evolve without breaking the crate's public API. ```rust // PublicError is public, but opaque and easy to keep compatible. #[derive(Error, Debug)] #[error(transparent)] pub struct PublicError(#[from] ErrorRepr); impl PublicError { // Accessors for anything we do want to expose publicly. } // Private and free to change across minor version of the crate. #[derive(Error, Debug)] enum ErrorRepr { ... } ``` - See also the [`anyhow`] library for a convenient single error type to use in application code. [`anyhow`]: https://github.com/dtolnay/anyhow
    ## Comparison to anyhow Use thiserror if you care about designing your own dedicated error type(s) so that the caller receives exactly the information that you choose in the event of failure. This most often applies to library-like code. Use [Anyhow] if you don't care what error type your functions return, you just want it to be easy. This is common in application-like code. [Anyhow]: https://github.com/dtolnay/anyhow
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/thiserror-1.0.69/README.md derive(Error) ============= [github](https://github.com/dtolnay/thiserror) [crates.io](https://crates.io/crates/thiserror) [docs.rs](https://docs.rs/thiserror) [build status](https://github.com/dtolnay/thiserror/actions?query=branch%3Amaster) This library provides a convenient derive macro for the standard library's [`std::error::Error`] trait. [`std::error::Error`]: https://doc.rust-lang.org/std/error/trait.Error.html ```toml [dependencies] thiserror = "1.0" ``` *Compiler support: requires rustc 1.61+*
    ## Example ```rust use thiserror::Error; #[derive(Error, Debug)] pub enum DataStoreError { #[error("data store disconnected")] Disconnect(#[from] io::Error), #[error("the data for key `{0}` is not available")] Redaction(String), #[error("invalid header (expected {expected:?}, found {found:?})")] InvalidHeader { expected: String, found: String, }, #[error("unknown data store error")] Unknown, } ```
    ## Details - Thiserror deliberately does not appear in your public API. You get the same thing as if you had written an implementation of `std::error::Error` by hand, and switching from handwritten impls to thiserror or vice versa is not a breaking change. - Errors may be enums, structs with named fields, tuple structs, or unit structs. - A `Display` impl is generated for your error if you provide `#[error("...")]` messages on the struct or each variant of your enum, as shown above in the example. The messages support a shorthand for interpolating fields from the error. - `#[error("{var}")]` ⟶ `write!("{}", self.var)` - `#[error("{0}")]` ⟶ `write!("{}", self.0)` - `#[error("{var:?}")]` ⟶ `write!("{:?}", self.var)` - `#[error("{0:?}")]` ⟶ `write!("{:?}", self.0)` These shorthands can be used together with any additional format args, which may be arbitrary expressions. For example: ```rust #[derive(Error, Debug)] pub enum Error { #[error("invalid rdo_lookahead_frames {0} (expected < {})", i32::MAX)] InvalidLookahead(u32), } ``` If one of the additional expression arguments needs to refer to a field of the struct or enum, then refer to named fields as `.var` and tuple fields as `.0`. ```rust #[derive(Error, Debug)] pub enum Error { #[error("first letter must be lowercase but was {:?}", first_char(.0))] WrongCase(String), #[error("invalid index {idx}, expected at least {} and at most {}", .limits.lo, .limits.hi)] OutOfBounds { idx: usize, limits: Limits }, } ``` - A `From` impl is generated for each variant that contains a `#[from]` attribute. The variant using `#[from]` must not contain any other fields beyond the source error (and possibly a backtrace — see below). Usually `#[from]` fields are unnamed, but `#[from]` is allowed on a named field too. ```rust #[derive(Error, Debug)] pub enum MyError { Io(#[from] io::Error), Glob(#[from] globset::Error), } ``` - The Error trait's `source()` method is implemented to return whichever field has a `#[source]` attribute or is named `source`, if any. This is for identifying the underlying lower level error that caused your error. The `#[from]` attribute always implies that the same field is `#[source]`, so you don't ever need to specify both attributes. Any error type that implements `std::error::Error` or dereferences to `dyn std::error::Error` will work as a source. ```rust #[derive(Error, Debug)] pub struct MyError { msg: String, #[source] // optional if field name is `source` source: anyhow::Error, } ``` - The Error trait's `provide()` method is implemented to provide whichever field has a type named `Backtrace`, if any, as a `std::backtrace::Backtrace`. Using `Backtrace` in errors requires a nightly compiler with Rust version 1.73 or newer. ```rust use std::backtrace::Backtrace; #[derive(Error, Debug)] pub struct MyError { msg: String, backtrace: Backtrace, // automatically detected } ``` - If a field is both a source (named `source`, or has `#[source]` or `#[from]` attribute) *and* is marked `#[backtrace]`, then the Error trait's `provide()` method is forwarded to the source's `provide` so that both layers of the error share the same backtrace. The `#[backtrace]` attribute requires a nightly compiler with Rust version 1.73 or newer. ```rust #[derive(Error, Debug)] pub enum MyError { Io { #[backtrace] source: io::Error, }, } ``` - For variants that use `#[from]` and also contain a `Backtrace` field, a backtrace is captured from within the `From` impl. ```rust #[derive(Error, Debug)] pub enum MyError { Io { #[from] source: io::Error, backtrace: Backtrace, }, } ``` - Errors may use `error(transparent)` to forward the source and Display methods straight through to an underlying error without adding an additional message. This would be appropriate for enums that need an "anything else" variant. ```rust #[derive(Error, Debug)] pub enum MyError { ... #[error(transparent)] Other(#[from] anyhow::Error), // source and Display delegate to anyhow::Error } ``` Another use case is hiding implementation details of an error representation behind an opaque error type, so that the representation is able to evolve without breaking the crate's public API. ```rust // PublicError is public, but opaque and easy to keep compatible. #[derive(Error, Debug)] #[error(transparent)] pub struct PublicError(#[from] ErrorRepr); impl PublicError { // Accessors for anything we do want to expose publicly. } // Private and free to change across minor version of the crate. #[derive(Error, Debug)] enum ErrorRepr { ... } ``` - See also the [`anyhow`] library for a convenient single error type to use in application code. [`anyhow`]: https://github.com/dtolnay/anyhow
    ## Comparison to anyhow Use thiserror if you care about designing your own dedicated error type(s) so that the caller receives exactly the information that you choose in the event of failure. This most often applies to library-like code. Use [Anyhow] if you don't care what error type your functions return, you just want it to be easy. This is common in application-like code. [Anyhow]: https://github.com/dtolnay/anyhow
    #### License Licensed under either of Apache License, Version 2.0 or MIT license at your option.
    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/thread_local/README.md thread_local ============ [![Build Status](https://github.com/Amanieu/thread_local-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/Amanieu/thread_local-rs/actions) [![crates.io](https://img.shields.io/crates/v/thread_local.svg)](https://crates.io/crates/thread_local) This library provides the `ThreadLocal` type which allow a separate copy of an object to be used for each thread. This allows for per-object thread-local storage, unlike the standard library's `thread_local!` macro which only allows static thread-local storage. [Documentation](https://docs.rs/thread_local/) ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] thread_local = "1.1" ``` ## Minimum Rust version This crate's minimum supported Rust version (MSRV) is 1.59.0. ## License Licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/time/README.md # time [![minimum rustc: 1.67.1](https://img.shields.io/badge/minimum%20rustc-1.67.1-yellowgreen?logo=rust&style=flat-square)](https://www.whatrustisit.com) [![version](https://img.shields.io/crates/v/time?color=blue&logo=rust&style=flat-square)](https://crates.io/crates/time) [![build status](https://img.shields.io/github/actions/workflow/status/time-rs/time/build.yaml?branch=main&style=flat-square)](https://github.com/time-rs/time/actions) [![codecov](https://codecov.io/gh/time-rs/time/branch/main/graph/badge.svg?token=yt4XSmQNKQ)](https://codecov.io/gh/time-rs/time) Documentation: - [latest release](https://docs.rs/time) - [main branch](https://time-rs.github.io/api/time) - [book](https://time-rs.github.io/book) ## Minimum Rust version policy `time` is guaranteed to compile with the latest stable release of Rust in addition to the two prior minor releases. For example, if the latest stable Rust release is 1.70, then `time` is guaranteed to compile with Rust 1.68, 1.69, and 1.70. The minimum supported Rust version may be increased to one of the aforementioned versions if doing so provides the end user a benefit. However, the minimum supported Rust version may also be bumped to a version four minor releases prior to the most recent stable release if doing so improves code quality or maintainability. For interoperability with third-party crates, it is guaranteed that there exists a version of that crate that supports the minimum supported Rust version of `time`. This does not mean that the latest version of the third-party crate supports the minimum supported Rust version of `time`. ## Contributing Contributions are always welcome! If you have an idea, it's best to float it by me before working on it to ensure no effort is wasted. If there's already an open issue for it, knock yourself out. Internal documentation can be viewed [here](https://time-rs.github.io/internal-api/time). If you have any questions, feel free to use [Discussions]. Don't hesitate to ask questions — that's what I'm here for! [Discussions]: https://github.com/time-rs/time/discussions ## License This project is licensed under either of - [Apache License, Version 2.0](https://github.com/time-rs/time/blob/main/LICENSE-Apache) - [MIT license](https://github.com/time-rs/time/blob/main/LICENSE-MIT) at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in time by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/toml/README.md # toml [![Latest Version](https://img.shields.io/crates/v/toml.svg)](https://crates.io/crates/toml) [![Documentation](https://docs.rs/toml/badge.svg)](https://docs.rs/toml) A [serde]-compatible [TOML][toml] decoder and encoder for Rust. For format-preserving edits or finer control over output, see [toml_edit] [serde]: https://serde.rs/ [toml]: https://github.com/toml-lang/toml [toml_edit]: https://docs.rs/toml_edit # License This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in toml-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/tracing/README.md ![Tracing — Structured, application-level diagnostics][splash] [splash]: https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/splash.svg # tracing Application-level tracing for Rust. [![Crates.io][crates-badge]][crates-url] [![Documentation][docs-badge]][docs-url] [![Documentation (master)][docs-master-badge]][docs-master-url] [![MIT licensed][mit-badge]][mit-url] [![Build Status][actions-badge]][actions-url] [![Discord chat][discord-badge]][discord-url] [Documentation][docs-url] | [Chat][discord-url] [crates-badge]: https://img.shields.io/crates/v/tracing.svg [crates-url]: https://crates.io/crates/tracing [docs-badge]: https://docs.rs/tracing/badge.svg [docs-url]: https://docs.rs/tracing [docs-master-badge]: https://img.shields.io/badge/docs-master-blue [docs-master-url]: https://tracing-rs.netlify.com/tracing [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-url]: LICENSE [actions-badge]: https://github.com/tokio-rs/tracing/workflows/CI/badge.svg [actions-url]:https://github.com/tokio-rs/tracing/actions?query=workflow%3ACI [discord-badge]: https://img.shields.io/discord/500028886025895936?logo=discord&label=discord&logoColor=white [discord-url]: https://discord.gg/EeF3cQw ## Overview `tracing` is a framework for instrumenting Rust programs to collect structured, event-based diagnostic information. In asynchronous systems like Tokio, interpreting traditional log messages can often be quite challenging. Since individual tasks are multiplexed on the same thread, associated events and log lines are intermixed making it difficult to trace the logic flow. `tracing` expands upon logging-style diagnostics by allowing libraries and applications to record structured events with additional information about *temporality* and *causality* — unlike a log message, a span in `tracing` has a beginning and end time, may be entered and exited by the flow of execution, and may exist within a nested tree of similar spans. In addition, `tracing` spans are *structured*, with the ability to record typed data as well as textual messages. The `tracing` crate provides the APIs necessary for instrumenting libraries and applications to emit trace data. *Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions ## Usage (The examples below are borrowed from the `log` crate's yak-shaving [example](https://docs.rs/log/0.4.10/log/index.html#examples), modified to idiomatic `tracing`.) ### In Applications In order to record trace events, executables have to use a `Subscriber` implementation compatible with `tracing`. A `Subscriber` implements a way of collecting trace data, such as by logging it to standard output. [`tracing_subscriber`](https://docs.rs/tracing-subscriber/)'s [`fmt` module](https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/fmt/index.html) provides reasonable defaults. Additionally, `tracing-subscriber` is able to consume messages emitted by `log`-instrumented libraries and modules. The simplest way to use a subscriber is to call the `set_global_default` function. ```rust use tracing::{info, Level}; use tracing_subscriber::FmtSubscriber; fn main() { // a builder for `FmtSubscriber`. let subscriber = FmtSubscriber::builder() // all spans/events with a level higher than TRACE (e.g, debug, info, warn, etc.) // will be written to stdout. .with_max_level(Level::TRACE) // completes the builder. .finish(); tracing::subscriber::set_global_default(subscriber) .expect("setting default subscriber failed"); let number_of_yaks = 3; // this creates a new event, outside of any spans. info!(number_of_yaks, "preparing to shave yaks"); let number_shaved = yak_shave::shave_all(number_of_yaks); info!( all_yaks_shaved = number_shaved == number_of_yaks, "yak shaving completed." ); } ``` ```toml [dependencies] tracing = "0.1" tracing-subscriber = "0.3.0" ``` This subscriber will be used as the default in all threads for the remainder of the duration of the program, similar to how loggers work in the `log` crate. In addition, you can locally override the default subscriber. For example: ```rust use tracing::{info, Level}; use tracing_subscriber::FmtSubscriber; fn main() { let subscriber = tracing_subscriber::FmtSubscriber::builder() // all spans/events with a level higher than TRACE (e.g, debug, info, warn, etc.) // will be written to stdout. .with_max_level(Level::TRACE) // builds the subscriber. .finish(); tracing::subscriber::with_default(subscriber, || { info!("This will be logged to stdout"); }); info!("This will _not_ be logged to stdout"); } ``` This approach allows trace data to be collected by multiple subscribers within different contexts in the program. Note that the override only applies to the currently executing thread; other threads will not see the change from with_default. Any trace events generated outside the context of a subscriber will not be collected. Once a subscriber has been set, instrumentation points may be added to the executable using the `tracing` crate's macros. ### In Libraries Libraries should only rely on the `tracing` crate and use the provided macros and types to collect whatever information might be useful to downstream consumers. ```rust use std::{error::Error, io}; use tracing::{debug, error, info, span, warn, Level}; // the `#[tracing::instrument]` attribute creates and enters a span // every time the instrumented function is called. The span is named after the // the function or method. Parameters passed to the function are recorded as fields. #[tracing::instrument] pub fn shave(yak: usize) -> Result<(), Box> { // this creates an event at the DEBUG level with two fields: // - `excitement`, with the key "excitement" and the value "yay!" // - `message`, with the key "message" and the value "hello! I'm gonna shave a yak." // // unlike other fields, `message`'s shorthand initialization is just the string itself. debug!(excitement = "yay!", "hello! I'm gonna shave a yak."); if yak == 3 { warn!("could not locate yak!"); // note that this is intended to demonstrate `tracing`'s features, not idiomatic // error handling! in a library or application, you should consider returning // a dedicated `YakError`. libraries like snafu or thiserror make this easy. return Err(io::Error::new(io::ErrorKind::Other, "shaving yak failed!").into()); } else { debug!("yak shaved successfully"); } Ok(()) } pub fn shave_all(yaks: usize) -> usize { // Constructs a new span named "shaving_yaks" at the TRACE level, // and a field whose key is "yaks". This is equivalent to writing: // // let span = span!(Level::TRACE, "shaving_yaks", yaks = yaks); // // local variables (`yaks`) can be used as field values // without an assignment, similar to struct initializers. let _span_ = span!(Level::TRACE, "shaving_yaks", yaks).entered(); info!("shaving yaks"); let mut yaks_shaved = 0; for yak in 1..=yaks { let res = shave(yak); debug!(yak, shaved = res.is_ok()); if let Err(ref error) = res { // Like spans, events can also use the field initialization shorthand. // In this instance, `yak` is the field being initialized. error!(yak, error = error.as_ref(), "failed to shave yak!"); } else { yaks_shaved += 1; } debug!(yaks_shaved); } yaks_shaved } ``` ```toml [dependencies] tracing = "0.1" ``` Note: Libraries should *NOT* call `set_global_default()`, as this will cause conflicts when executables try to set the default later. ### In Asynchronous Code If you are instrumenting code that make use of [`std::future::Future`](https://doc.rust-lang.org/stable/std/future/trait.Future.html) or async/await, avoid using the `Span::enter` method. The following example _will not_ work: ```rust async { let _s = span.enter(); // ... } ``` ```rust async { let _s = tracing::span!(...).entered(); // ... } ``` The span guard `_s` will not exit until the future generated by the `async` block is complete. Since futures and spans can be entered and exited _multiple_ times without them completing, the span remains entered for as long as the future exists, rather than being entered only when it is polled, leading to very confusing and incorrect output. For more details, see [the documentation on closing spans](https://tracing.rs/tracing/span/index.html#closing-spans). There are two ways to instrument asynchronous code. The first is through the [`Future::instrument`](https://docs.rs/tracing/latest/tracing/trait.Instrument.html#method.instrument) combinator: ```rust use tracing::Instrument; let my_future = async { // ... }; my_future .instrument(tracing::info_span!("my_future")) .await ``` `Future::instrument` attaches a span to the future, ensuring that the span's lifetime is as long as the future's. The second, and preferred, option is through the [`#[instrument]`](https://docs.rs/tracing/0.1.41/tracing/attr.instrument.html) attribute: ```rust use tracing::{info, instrument}; use tokio::{io::AsyncWriteExt, net::TcpStream}; use std::io; #[instrument] async fn write(stream: &mut TcpStream) -> io::Result { let result = stream.write(b"hello world\n").await; info!("wrote to stream; success={:?}", result.is_ok()); result } ``` Under the hood, the `#[instrument]` macro performs the same explicit span attachment that `Future::instrument` does. ### Concepts This crate provides macros for creating `Span`s and `Event`s, which represent periods of time and momentary events within the execution of a program, respectively. As a rule of thumb, _spans_ should be used to represent discrete units of work (e.g., a given request's lifetime in a server) or periods of time spent in a given context (e.g., time spent interacting with an instance of an external system, such as a database). In contrast, _events_ should be used to represent points in time within a span — a request returned with a given status code, _n_ new items were taken from a queue, and so on. `Span`s are constructed using the `span!` macro, and then _entered_ to indicate that some code takes place within the context of that `Span`: ```rust use tracing::{span, Level}; // Construct a new span named "my span". let mut span = span!(Level::INFO, "my span"); span.in_scope(|| { // Any trace events in this closure or code called by it will occur within // the span. }); // Dropping the span will close it, indicating that it has ended. ``` The [`#[instrument]`](https://docs.rs/tracing/0.1.41/tracing/attr.instrument.html) attribute macro can reduce some of this boilerplate: ```rust use tracing::{instrument}; #[instrument] pub fn my_function(my_arg: usize) { // This event will be recorded inside a span named `my_function` with the // field `my_arg`. tracing::info!("inside my_function!"); // ... } ``` The `Event` type represent an event that occurs instantaneously, and is essentially a `Span` that cannot be entered. They are created using the `event!` macro: ```rust use tracing::{event, Level}; event!(Level::INFO, "something has happened!"); ``` Users of the [`log`] crate should note that `tracing` exposes a set of macros for creating `Event`s (`trace!`, `debug!`, `info!`, `warn!`, and `error!`) which may be invoked with the same syntax as the similarly-named macros from the `log` crate. Often, the process of converting a project to use `tracing` can begin with a simple drop-in replacement. ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported version is 1.42. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio project. The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.45, the minimum supported version will not be increased past 1.42, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy. ## Ecosystem ### Related Crates In addition to `tracing` and `tracing-core`, the [`tokio-rs/tracing`] repository contains several additional crates designed to be used with the `tracing` ecosystem. This includes a collection of `Subscriber` implementations, as well as utility and adapter crates to assist in writing `Subscriber`s and instrumenting applications. In particular, the following crates are likely to be of interest: - [`tracing-futures`] provides a compatibility layer with the `futures` crate, allowing spans to be attached to `Future`s, `Stream`s, and `Executor`s. - [`tracing-subscriber`] provides `Subscriber` implementations and utilities for working with `Subscriber`s. This includes a [`FmtSubscriber`] `FmtSubscriber` for logging formatted trace data to stdout, with similar filtering and formatting to the [`env_logger`] crate. - [`tracing-log`] provides a compatibility layer with the [`log`] crate, allowing log messages to be recorded as `tracing` `Event`s within the trace tree. This is useful when a project using `tracing` have dependencies which use `log`. Note that if you're using `tracing-subscriber`'s `FmtSubscriber`, you don't need to depend on `tracing-log` directly. Additionally, there are also several third-party crates which are not maintained by the `tokio` project. These include: - [`tracing-timing`] implements inter-event timing metrics on top of `tracing`. It provides a subscriber that records the time elapsed between pairs of `tracing` events and generates histograms. - [`tracing-opentelemetry`] provides a subscriber for emitting traces to [OpenTelemetry]-compatible distributed tracing systems. - [`tracing-honeycomb`] Provides a layer that reports traces spanning multiple machines to [honeycomb.io]. Backed by [`tracing-distributed`]. - [`tracing-distributed`] Provides a generic implementation of a layer that reports traces spanning multiple machines to some backend. - [`tracing-actix`] provides `tracing` integration for the `actix` actor framework. - [`axum-insights`] provides `tracing` integration and Application insights export for the `axum` web framework. - [`tracing-gelf`] implements a subscriber for exporting traces in Greylog GELF format. - [`tracing-coz`] provides integration with the [coz] causal profiler (Linux-only). - [`test-log`] takes care of initializing `tracing` for tests, based on environment variables with an `env_logger` compatible syntax. - [`tracing-unwrap`] provides convenience methods to report failed unwraps on `Result` or `Option` types to a `Subscriber`. - [`diesel-tracing`] provides integration with [`diesel`] database connections. - [`tracing-tracy`] provides a way to collect [Tracy] profiles in instrumented applications. - [`tracing-elastic-apm`] provides a layer for reporting traces to [Elastic APM]. - [`tracing-etw`] provides a layer for emitting Windows [ETW] events. - [`tracing-fluent-assertions`] provides a fluent assertions-style testing framework for validating the behavior of `tracing` spans. - [`sentry-tracing`] provides a layer for reporting events and traces to [Sentry]. - [`tracing-loki`] provides a layer for shipping logs to [Grafana Loki]. - [`tracing-logfmt`] provides a layer that formats events and spans into the logfmt format. - [`json-subscriber`] provides a layer for emitting JSON logs. The output can be customized much more than with [`FmtSubscriber`]'s JSON output. If you're the maintainer of a `tracing` ecosystem crate not listed above, please let us know! We'd love to add your project to the list! [`tracing-timing`]: https://crates.io/crates/tracing-timing [`tracing-opentelemetry`]: https://crates.io/crates/tracing-opentelemetry [OpenTelemetry]: https://opentelemetry.io/ [`tracing-honeycomb`]: https://crates.io/crates/tracing-honeycomb [`tracing-distributed`]: https://crates.io/crates/tracing-distributed [honeycomb.io]: https://www.honeycomb.io/ [`tracing-actix`]: https://crates.io/crates/tracing-actix [`axum-insights`]: https://crates.io/crates/axum-insights [`tracing-gelf`]: https://crates.io/crates/tracing-gelf [`tracing-coz`]: https://crates.io/crates/tracing-coz [coz]: https://github.com/plasma-umass/coz [`test-log`]: https://crates.io/crates/test-log [`tracing-unwrap`]: https://docs.rs/tracing-unwrap [`diesel`]: https://crates.io/crates/diesel [`diesel-tracing`]: https://crates.io/crates/diesel-tracing [`tracing-tracy`]: https://crates.io/crates/tracing-tracy [Tracy]: https://github.com/wolfpld/tracy [`tracing-elastic-apm`]: https://crates.io/crates/tracing-elastic-apm [Elastic APM]: https://www.elastic.co/apm [`tracing-etw`]: https://github.com/microsoft/tracing-etw [ETW]: https://docs.microsoft.com/en-us/windows/win32/etw/about-event-tracing [`tracing-fluent-assertions`]: https://crates.io/crates/tracing-fluent-assertions [`sentry-tracing`]: https://crates.io/crates/sentry-tracing [Sentry]: https://sentry.io/welcome/ [`tracing-loki`]: https://crates.io/crates/tracing-loki [Grafana Loki]: https://grafana.com/oss/loki/ [`tracing-logfmt`]: https://crates.io/crates/tracing-logfmt [`json-subscriber`]: https://crates.io/crates/json-subscriber **Note:** that some of the ecosystem crates are currently unreleased and undergoing active development. They may be less stable than `tracing` and `tracing-core`. [`log`]: https://docs.rs/log/0.4.6/log/ [`tokio-rs/tracing`]: https://github.com/tokio-rs/tracing [`tracing-futures`]: https://github.com/tokio-rs/tracing/tree/master/tracing-futures [`tracing-subscriber`]: https://github.com/tokio-rs/tracing/tree/master/tracing-subscriber [`tracing-log`]: https://github.com/tokio-rs/tracing/tree/master/tracing-log [`env_logger`]: https://crates.io/crates/env_logger [`FmtSubscriber`]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/struct.Subscriber.html [`examples`]: https://github.com/tokio-rs/tracing/tree/master/examples ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio project. The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.69, the minimum supported version will not be increased past 1.66, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy. ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/tracing-attributes/README.md ![Tracing — Structured, application-level diagnostics][splash] [splash]: https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/splash.svg # tracing-attributes Macro attributes for application-level tracing. [![Crates.io][crates-badge]][crates-url] [![Documentation][docs-badge]][docs-url] [![Documentation (master)][docs-master-badge]][docs-master-url] [![MIT licensed][mit-badge]][mit-url] [![Build Status][actions-badge]][actions-url] [![Discord chat][discord-badge]][discord-url] [Documentation][docs-url] | [Chat][discord-url] [crates-badge]: https://img.shields.io/crates/v/tracing-attributes.svg [crates-url]: https://crates.io/crates/tracing-attributes [docs-badge]: https://docs.rs/tracing-attributes/badge.svg [docs-url]: https://docs.rs/tracing-attributes/0.1.28 [docs-master-badge]: https://img.shields.io/badge/docs-master-blue [docs-master-url]: https://tracing-rs.netlify.com/tracing_attributes [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-url]: LICENSE [actions-badge]: https://github.com/tokio-rs/tracing/workflows/CI/badge.svg [actions-url]:https://github.com/tokio-rs/tracing/actions?query=workflow%3ACI [discord-badge]: https://img.shields.io/discord/500028886025895936?logo=discord&label=discord&logoColor=white [discord-url]: https://discord.gg/EeF3cQw ## Overview [`tracing`] is a framework for instrumenting Rust programs to collect structured, event-based diagnostic information. This crate provides the `#[instrument]` attribute for automatically instrumenting functions using `tracing`. Note that this macro is also re-exported by the main `tracing` crate. *Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions ## Usage First, add this to your `Cargo.toml`: ```toml [dependencies] tracing-attributes = "0.1.28" ``` This crate provides the `#[instrument]` attribute for instrumenting a function with a `tracing` [span]. For example: ```rust use tracing_attributes::instrument; #[instrument] pub fn my_function(my_arg: usize) { // ... } ``` [`tracing`]: https://crates.io/crates/tracing [span]: https://docs.rs/tracing/latest/tracing/span/index.html ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio project. The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.69, the minimum supported version will not be increased past 1.66, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy. ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/tracing-core/README.md ![Tracing — Structured, application-level diagnostics][splash] [splash]: https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/splash.svg # tracing-core Core primitives for application-level tracing. [![Crates.io][crates-badge]][crates-url] [![Documentation][docs-badge]][docs-url] [![Documentation (master)][docs-master-badge]][docs-master-url] [![MIT licensed][mit-badge]][mit-url] [![Build Status][actions-badge]][actions-url] [![Discord chat][discord-badge]][discord-url] [Documentation][docs-url] | [Chat][discord-url] [crates-badge]: https://img.shields.io/crates/v/tracing-core.svg [crates-url]: https://crates.io/crates/tracing-core/0.1.33 [docs-badge]: https://docs.rs/tracing-core/badge.svg [docs-url]: https://docs.rs/tracing-core/0.1.33 [docs-master-badge]: https://img.shields.io/badge/docs-master-blue [docs-master-url]: https://tracing-rs.netlify.com/tracing_core [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-url]: LICENSE [actions-badge]: https://github.com/tokio-rs/tracing/workflows/CI/badge.svg [actions-url]:https://github.com/tokio-rs/tracing/actions?query=workflow%3ACI [discord-badge]: https://img.shields.io/discord/500028886025895936?logo=discord&label=discord&logoColor=white [discord-url]: https://discord.gg/EeF3cQw ## Overview [`tracing`] is a framework for instrumenting Rust programs to collect structured, event-based diagnostic information. This crate defines the core primitives of `tracing`. The crate provides: * [`span::Id`] identifies a span within the execution of a program. * [`Event`] represents a single event within a trace. * [`Subscriber`], the trait implemented to collect trace data. * [`Metadata`] and [`Callsite`] provide information describing spans and events. * [`Field`], [`FieldSet`], [`Value`], and [`ValueSet`] represent the structured data attached to spans and events. * [`Dispatch`] allows spans and events to be dispatched to `Subscriber`s. In addition, it defines the global callsite registry and per-thread current dispatcher which other components of the tracing system rely on. *Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions ## Usage Application authors will typically not use this crate directly. Instead, they will use the [`tracing`] crate, which provides a much more fully-featured API. However, this crate's API will change very infrequently, so it may be used when dependencies must be very stable. `Subscriber` implementations may depend on `tracing-core` rather than `tracing`, as the additional APIs provided by `tracing` are primarily useful for instrumenting libraries and applications, and are generally not necessary for `Subscriber` implementations. ### Crate Feature Flags The following crate feature flags are available: * `std`: Depend on the Rust standard library (enabled by default). `no_std` users may disable this feature with `default-features = false`: ```toml [dependencies] tracing-core = { version = "0.1.33", default-features = false } ``` **Note**:`tracing-core`'s `no_std` support requires `liballoc`. [`tracing`]: ../tracing [`span::Id`]: https://docs.rs/tracing-core/0.1.33/tracing_core/span/struct.Id.html [`Event`]: https://docs.rs/tracing-core/0.1.33/tracing_core/event/struct.Event.html [`Subscriber`]: https://docs.rs/tracing-core/0.1.33/tracing_core/subscriber/trait.Subscriber.html [`Metadata`]: https://docs.rs/tracing-core/0.1.33/tracing_core/metadata/struct.Metadata.html [`Callsite`]: https://docs.rs/tracing-core/0.1.33/tracing_core/callsite/trait.Callsite.html [`Field`]: https://docs.rs/tracing-core/0.1.33/tracing_core/field/struct.Field.html [`FieldSet`]: https://docs.rs/tracing-core/0.1.33/tracing_core/field/struct.FieldSet.html [`Value`]: https://docs.rs/tracing-core/0.1.33/tracing_core/field/trait.Value.html [`ValueSet`]: https://docs.rs/tracing-core/0.1.33/tracing_core/field/struct.ValueSet.html [`Dispatch`]: https://docs.rs/tracing-core/0.1.33/tracing_core/dispatcher/struct.Dispatch.html ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio project. The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.69, the minimum supported version will not be increased past 1.69, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy. ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/tracing-log/README.md ![Tracing — Structured, application-level diagnostics][splash] [splash]: https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/splash.svg # tracing-log [`log`] compatibility for [`tracing`]. [![Crates.io][crates-badge]][crates-url] [![Documentation][docs-badge]][docs-url] [![Documentation (master)][docs-master-badge]][docs-master-url] [![MIT licensed][mit-badge]][mit-url] [![Build Status][actions-badge]][actions-url] [![Discord chat][discord-badge]][discord-url] ![maintenance status][maint-badge] [Documentation][docs-url] | [Chat (discord)][discord-url] [crates-badge]: https://img.shields.io/crates/v/tracing-log.svg [crates-url]: https://crates.io/crates/tracing-log [docs-badge]: https://docs.rs/tracing-log/badge.svg [docs-url]: https://docs.rs/tracing-log [docs-master-badge]: https://img.shields.io/badge/docs-master-blue [docs-master-url]: https://tracing-rs.netlify.com/tracing_log [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-url]: LICENSE [actions-badge]: https://github.com/tokio-rs/tracing/workflows/CI/badge.svg [actions-url]:https://github.com/tokio-rs/tracing/actions?query=workflow%3ACI [discord-badge]: https://img.shields.io/discord/500028886025895936?logo=discord&label=discord&logoColor=white [discord-url]: https://discord.gg/EeF3cQw [maint-badge]: https://img.shields.io/badge/maintenance-experimental-blue.svg ## Overview [`tracing`] is a framework for instrumenting Rust programs with context-aware, structured, event-based diagnostic information. This crate provides compatibility layers for using `tracing` alongside the logging facade provided by the [`log`] crate. This crate provides: - [`AsTrace`] and [`AsLog`] traits for converting between `tracing` and `log` types. - [`LogTracer`], a [`log::Log`] implementation that consumes [`log::Record`]s and outputs them as [`tracing::Event`]s. [`tracing`]: https://crates.io/crates/tracing [`log`]: https://crates.io/crates/log [`AsTrace`]: https://docs.rs/tracing-log/latest/tracing_log/trait.AsTrace.html [`AsLog`]: https://docs.rs/tracing-log/latest/tracing_log/trait.AsLog.html [`LogTracer`]: https://docs.rs/tracing-log/latest/tracing_log/struct.LogTracer.html [`log::Log`]: https://docs.rs/log/latest/log/trait.Log.html [`log::Record`]: https://docs.rs/log/latest/log/struct.Record.html [`tracing::Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html [`tracing::Event`]: https://docs.rs/tracing/latest/tracing/struct.Event.html *Compiler support: [requires `rustc` 1.56+][msrv]* [msrv]: #supported-rust-versions ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported version is 1.56. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio project. The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.69, the minimum supported version will not be increased past 1.66, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy. ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tracing by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/tracing-subscriber/README.md ![Tracing — Structured, application-level diagnostics][splash] [splash]: https://raw.githubusercontent.com/tokio-rs/tracing/main/assets/splash.svg # tracing-subscriber Utilities for implementing and composing [`tracing`][tracing] subscribers. [`tracing`] is a framework for instrumenting Rust programs to collect scoped, structured, and async-aware diagnostics. The `Subscriber` trait represents the functionality necessary to collect this trace data. This crate contains tools for composing subscribers out of smaller units of behaviour, and batteries-included implementations of common subscriber functionality. `tracing-subscriber` is intended for use by both `Subscriber` authors and application authors using `tracing` to instrument their applications. [![Crates.io][crates-badge]][crates-url] [![Documentation][docs-badge]][docs-url] [![Documentation (v0.2.x)][docs-v0.2.x-badge]][docs-v0.2.x-url] [![MIT licensed][mit-badge]][mit-url] [![Build Status][actions-badge]][actions-url] [![Discord chat][discord-badge]][discord-url] ![maintenance status][maint-badge] [Documentation][docs-url] | [Chat][discord-url] [tracing]: https://github.com/tokio-rs/tracing/tree/main/tracing [tracing-fmt]: https://github.com/tokio-rs/tracing/tree/main/tracing-subscriber [crates-badge]: https://img.shields.io/crates/v/tracing-subscriber.svg [crates-url]: https://crates.io/crates/tracing-subscriber [docs-badge]: https://docs.rs/tracing-subscriber/badge.svg [docs-url]: https://docs.rs/tracing-subscriber/latest [docs-v0.2.x-badge]: https://img.shields.io/badge/docs-v0.2.x-blue [docs-v0.2.x-url]: https://tracing.rs/tracing_subscriber [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-url]: LICENSE [actions-badge]: https://github.com/tokio-rs/tracing/workflows/CI/badge.svg [actions-url]:https://github.com/tokio-rs/tracing/actions?query=workflow%3ACI [discord-badge]: https://img.shields.io/discord/500028886025895936?logo=discord&label=discord&logoColor=white [discord-url]: https://discord.gg/EeF3cQw [maint-badge]: https://img.shields.io/badge/maintenance-experimental-blue.svg *Compiler support: [requires `rustc` 1.65+][msrv]* [msrv]: #supported-rust-versions ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported version is 1.65. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio project. The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.69, the minimum supported version will not be increased past 1.66, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy. ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tracing by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/typenum/README.md [![crates.io](https://img.shields.io/crates/v/typenum.svg)](https://crates.io/crates/typenum) [![Build Status](https://github.com/paholg/typenum/actions/workflows/check.yml/badge.svg)](https://github.com/paholg/typenum/actions/workflows/check.yml) Typenum ===== Typenum is a Rust library for type-level numbers evaluated at compile time. It currently supports bits, unsigned integers, and signed integers. Typenum depends only on libcore, and so is suitable for use on any platform! For the full documentation, go [here](https://docs.rs/typenum). ### Importing While `typenum` is divided into several modules, they are all re-exported through the crate root, so you can import anything contained herein with `use typenum::whatever;`, ignoring the crate structure. You may also find it useful to treat the `consts` module as a prelude, performing a glob import. ### Example Here is a trivial example of `typenum`'s use: ```rust use typenum::{Sum, Exp, Integer, N2, P3, P4}; type X = Sum; assert_eq!(::to_i32(), 7); type Y = Exp; assert_eq!(::to_i32(), -8); ``` For a non-trivial example of its use, see one of the crates that depends on it. The full list is [here](https://crates.io/crates/typenum/reverse_dependencies). Of note are [dimensioned](https://crates.io/crates/dimensioned/) which does compile-time type checking for arbitrary unit systems and [generic-array](https://crates.io/crates/generic-array/) which provides arrays whose length you can generically refer to. ### Error messages Typenum's error messages aren't great, and can be difficult to parse. The good news is that the fine folks at Auxon have written a tool to help with it. Please take a look at [tnfilt](https://github.com/auxoncorp/tnfilt). ### License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/unicode-ident/README.md Unicode ident ============= [github](https://github.com/dtolnay/unicode-ident) [crates.io](https://crates.io/crates/unicode-ident) [docs.rs](https://docs.rs/unicode-ident) [build status](https://github.com/dtolnay/unicode-ident/actions?query=branch%3Amaster) Implementation of [Unicode Standard Annex #31][tr31] for determining which `char` values are valid in programming language identifiers. [tr31]: https://www.unicode.org/reports/tr31/ This crate is a better optimized implementation of the older `unicode-xid` crate. This crate uses less static storage, and is able to classify both ASCII and non-ASCII codepoints with better performance, 2–6× faster than `unicode-xid`.
    ## Comparison of performance The following table shows a comparison between five Unicode identifier implementations. - `unicode-ident` is this crate; - [`unicode-xid`] is a widely used crate run by the "unicode-rs" org; - `ucd-trie` and `fst` are two data structures supported by the [`ucd-generate`] tool; - [`roaring`] is a Rust implementation of Roaring bitmap. The *static storage* column shows the total size of `static` tables that the crate bakes into your binary, measured in 1000s of bytes. The remaining columns show the **cost per call** to evaluate whether a single `char` has the XID\_Start or XID\_Continue Unicode property, comparing across different ratios of ASCII to non-ASCII codepoints in the input data. [`unicode-xid`]: https://github.com/unicode-rs/unicode-xid [`ucd-generate`]: https://github.com/BurntSushi/ucd-generate [`roaring`]: https://github.com/RoaringBitmap/roaring-rs | | static storage | 0% nonascii | 1% | 10% | 100% nonascii | |---|---|---|---|---|---| | **`unicode-ident`** | 10.4 K | 1.03 ns | 1.02 ns | 1.11 ns | 1.66 ns | | **`unicode-xid`** | 11.8 K | 2.57 ns | 2.74 ns | 3.20 ns | 9.35 ns | | **`ucd-trie`** | 10.3 K | 1.27 ns | 1.27 ns | 1.41 ns | 2.53 ns | | **`fst`** | 144 K | 49.3 ns | 49.1 ns | 47.1 ns | 27.9 ns | | **`roaring`** | 66.1 K | 4.10 ns | 4.05 ns | 4.02 ns | 5.12 ns | Source code for the benchmark is provided in the *bench* directory of this repo and may be repeated by running `cargo criterion`.
    ## Comparison of data structures #### unicode-xid They use a sorted array of character ranges, and do a binary search to look up whether a given character lands inside one of those ranges. ```rust static XID_Continue_table: [(char, char); 763] = [ ('\u{30}', '\u{39}'), // 0-9 ('\u{41}', '\u{5a}'), // A-Z … ('\u{e0100}', '\u{e01ef}'), ]; ``` The static storage used by this data structure scales with the number of contiguous ranges of identifier codepoints in Unicode. Every table entry consumes 8 bytes, because it consists of a pair of 32-bit `char` values. In some ranges of the Unicode codepoint space, this is quite a sparse representation – there are some ranges where tens of thousands of adjacent codepoints are all valid identifier characters. In other places, the representation is quite inefficient. A characater like `µ` (U+00B5) which is surrounded by non-identifier codepoints consumes 64 bits in the table, while it would be just 1 bit in a dense bitmap. On a system with 64-byte cache lines, binary searching the table touches 7 cache lines on average. Each cache line fits only 8 table entries. Additionally, the branching performed during the binary search is probably mostly unpredictable to the branch predictor. Overall, the crate ends up being about 6× slower on non-ASCII input compared to the fastest crate. A potential improvement would be to pack the table entries more compactly. Rust's `char` type is a 21-bit integer padded to 32 bits, which means every table entry is holding 22 bits of wasted space, adding up to 3.9 K. They could instead fit every table entry into 6 bytes, leaving out some of the padding, for a 25% improvement in space used. With some cleverness it may be possible to fit in 5 bytes or even 4 bytes by storing a low char and an extent, instead of low char and high char. I don't expect that performance would improve much but this could be the most efficient for space across all the libraries, needing only about 7 K to store. #### ucd-trie Their data structure is a compressed trie set specifically tailored for Unicode codepoints. The design is credited to Raph Levien in [rust-lang/rust#33098]. [rust-lang/rust#33098]: https://github.com/rust-lang/rust/pull/33098 ```rust pub struct TrieSet { tree1_level1: &'static [u64; 32], tree2_level1: &'static [u8; 992], tree2_level2: &'static [u64], tree3_level1: &'static [u8; 256], tree3_level2: &'static [u8], tree3_level3: &'static [u64], } ``` It represents codepoint sets using a trie to achieve prefix compression. The final states of the trie are embedded in leaves or "chunks", where each chunk is a 64-bit integer. Each bit position of the integer corresponds to whether a particular codepoint is in the set or not. These chunks are not just a compact representation of the final states of the trie, but are also a form of suffix compression. In particular, if multiple ranges of 64 contiguous codepoints have the same Unicode properties, then they all map to the same chunk in the final level of the trie. Being tailored for Unicode codepoints, this trie is partitioned into three disjoint sets: tree1, tree2, tree3. The first set corresponds to codepoints \[0, 0x800), the second \[0x800, 0x10000) and the third \[0x10000, 0x110000). These partitions conveniently correspond to the space of 1 or 2 byte UTF-8 encoded codepoints, 3 byte UTF-8 encoded codepoints and 4 byte UTF-8 encoded codepoints, respectively. Lookups in this data structure are significantly more efficient than binary search. A lookup touches either 1, 2, or 3 cache lines based on which of the trie partitions is being accessed. One possible performance improvement would be for this crate to expose a way to query based on a UTF-8 encoded string, returning the Unicode property corresponding to the first character in the string. Without such an API, the caller is required to tokenize their UTF-8 encoded input data into `char`, hand the `char` into `ucd-trie`, only for `ucd-trie` to undo that work by converting back into the variable-length representation for trie traversal. #### fst Uses a [finite state transducer][fst]. This representation is built into [ucd-generate] but I am not aware of any advantage over the `ucd-trie` representation. In particular `ucd-trie` is optimized for storing Unicode properties while `fst` is not. [fst]: https://github.com/BurntSushi/fst [ucd-generate]: https://github.com/BurntSushi/ucd-generate As far as I can tell, the main thing that causes `fst` to have large size and slow lookups for this use case relative to `ucd-trie` is that it does not specialize for the fact that only 21 of the 32 bits in a `char` are meaningful. There are some dense arrays in the structure with large ranges that could never possibly be used. #### roaring This crate is a pure-Rust implementation of [Roaring Bitmap], a data structure designed for storing sets of 32-bit unsigned integers. [Roaring Bitmap]: https://roaringbitmap.org/about/ Roaring bitmaps are compressed bitmaps which tend to outperform conventional compressed bitmaps such as WAH, EWAH or Concise. In some instances, they can be hundreds of times faster and they often offer significantly better compression. In this use case the performance was reasonably competitive but still substantially slower than the Unicode-optimized crates. Meanwhile the compression was significantly worse, requiring 6× as much storage for the data structure. I also benchmarked the [`croaring`] crate which is an FFI wrapper around the C reference implementation of Roaring Bitmap. This crate was consistently about 15% slower than pure-Rust `roaring`, which could just be FFI overhead. I did not investigate further. [`croaring`]: https://crates.io/crates/croaring #### unicode-ident This crate is most similar to the `ucd-trie` library, in that it's based on bitmaps stored in the leafs of a trie representation, achieving both prefix compression and suffix compression. The key differences are: - Uses a single 2-level trie, rather than 3 disjoint partitions of different depth each. - Uses significantly larger chunks: 512 bits rather than 64 bits. - Compresses the XID\_Start and XID\_Continue properties together simultaneously, rather than duplicating identical trie leaf chunks across the two. The following diagram show the XID\_Start and XID\_Continue Unicode boolean properties in uncompressed form, in row-major order:
    XID_StartXID_Continue
    XID_Start bitmap XID_Continue bitmap
    Uncompressed, these would take 140 K to store, which is beyond what would be reasonable. However, as you can see there is a large degree of similarity between the two bitmaps and across the rows, which lends well to compression. This crate stores one 512-bit "row" of the above bitmaps in the leaf level of a trie, and a single additional level to index into the leafs. It turns out there are 124 unique 512-bit chunks across the two bitmaps so 7 bits are sufficient to index them. The chunk size of 512 bits is selected as the size that minimizes the total size of the data structure. A smaller chunk, like 256 or 128 bits, would achieve better deduplication but require a larger index. A larger chunk would increase redundancy in the leaf bitmaps. 512 bit chunks are the optimum for total size of the index plus leaf bitmaps. In fact since there are only 124 unique chunks, we can use an 8-bit index with a spare bit to index at the half-chunk level. This achieves an additional 8.5% compression by eliminating redundancies between the second half of any chunk and the first half of any other chunk. Note that this is not the same as using chunks which are half the size, because it does not necessitate raising the size of the trie's first level. In contrast to binary search or the `ucd-trie` crate, performing lookups in this data structure is straight-line code with no need for branching. ```asm is_xid_start: mov eax, edi shr eax, 9 lea rcx, [rip + unicode_ident::tables::TRIE_START] add rcx, rax xor eax, eax cmp edi, 201728 cmovb rax, rcx test rax, rax lea rcx, [rip + .L__unnamed_1] cmovne rcx, rax movzx eax, byte ptr [rcx] shl rax, 5 mov ecx, edi shr ecx, 3 and ecx, 63 add rcx, rax lea rax, [rip + unicode_ident::tables::LEAF] mov al, byte ptr [rax + rcx] and dil, 7 mov ecx, edi shr al, cl and al, 1 ret ```
    ## License Use of the Unicode Character Database, as this crate does, is governed by the Unicode license. All intellectual property within this crate that is **not generated** using the Unicode Character Database as input is licensed under either of Apache License, Version 2.0 or MIT license at your option. The **generated** files incorporate tabular data derived from the Unicode Character Database, together with intellectual property from the original source code content of the crate. One must comply with the terms of both the Unicode License Agreement and either of the Apache license or MIT license when those generated files are involved. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be licensed as just described, without any additional terms or conditions. ## Files: rust/vendor/universal-hash/README.md # RustCrypto: Universal Hash Function Traits [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Traits which define functionality of [universal hash functions]. See [RustCrypto/universal-hashes] for implementations which use this trait. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.41** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/universal-hash.svg [crate-link]: https://crates.io/crates/universal-hash [docs-image]: https://docs.rs/universal-hash/badge.svg [docs-link]: https://docs.rs/universal-hash/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260051-universal-hashes [build-image]: https://github.com/RustCrypto/traits/workflows/universal-hash/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/traits/actions?query=workflow%3Auniversal-hash [//]: # (general links) [universal hash functions]: https://en.wikipedia.org/wiki/Universal_hashing [RustCrypto/universal-hashes]: https://github.com/RustCrypto/universal-hashes ## Files: rust/vendor/uuid/README.md uuid --------- [![Latest Version](https://img.shields.io/crates/v/uuid.svg)](https://crates.io/crates/uuid) [![Join the chat at https://gitter.im/uuid-rs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uuid-rs/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge) ![Minimum rustc version](https://img.shields.io/badge/rustc-1.34.0+-yellow.svg) [![Build Status](https://ci.appveyor.com/api/projects/status/github/uuid-rs/uuid?branch=master&svg=true)](https://ci.appveyor.com/project/uuid-rs/uuid/branch/master) [![Build Status](https://travis-ci.org/uuid-rs/uuid.svg?branch=master)](https://travis-ci.org/uuid-rs/uuid) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/uuid-rs/uuid.svg)](https://isitmaintained.com/project/uuid-rs/uuid "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/uuid-rs/uuid.svg)](https://isitmaintained.com/project/uuid-rs/uuid "Percentage of issues still open") [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid?ref=badge_shield) --- Generate and parse UUIDs. Provides support for Universally Unique Identifiers (UUIDs). A UUID is a unique 128-bit number, stored as 16 octets. UUIDs are used to assign unique identifiers to entities without requiring a central allocating authority. They are particularly useful in distributed systems, though they can be used in disparate areas, such as databases and network protocols. Typically a UUID is displayed in a readable string form as a sequence of hexadecimal digits, separated into groups by hyphens. The uniqueness property is not strictly guaranteed, however for all practical purposes, it can be assumed that an unintentional collision would be extremely unlikely. ## Dependencies By default, this crate depends on nothing but `std` and cannot generate [`Uuid`]s. You need to enable the following Cargo features to enable various pieces of functionality: * `v1` - adds the `Uuid::new_v1` function and the ability to create a V1 using an implementation of `uuid::v1::ClockSequence` (usually `uuid::v1::Context`) and a timestamp from `time::timespec`. * `v3` - adds the `Uuid::new_v3` function and the ability to create a V3 UUID based on the MD5 hash of some data. * `v4` - adds the `Uuid::new_v4` function and the ability to randomly generate a `Uuid`. * `v5` - adds the `Uuid::new_v5` function and the ability to create a V5 UUID based on the SHA1 hash of some data. * `serde` - adds the ability to serialize and deserialize a `Uuid` using the `serde` crate. You need to enable one of the following Cargo features together with `v3`, `v4` or `v5` feature if you're targeting `wasm32-unknown-unknown` target: * `stdweb` - enables support for `OsRng` on `wasm32-unknown-unknown` via `stdweb` combined with `cargo-web` * `wasm-bindgen` - `wasm-bindgen` enables support for `OsRng` on `wasm32-unknown-unknown` via [`wasm-bindgen`] By default, `uuid` can be depended on with: ```toml [dependencies] uuid = "0.8" ``` To activate various features, use syntax like: ```toml [dependencies] uuid = { version = "0.8", features = ["serde", "v4"] } ``` You can disable default features with: ```toml [dependencies] uuid = { version = "0.8", default-features = false } ``` ## Examples To parse a UUID given in the simple format and print it as a urn: ```rust use uuid::Uuid; fn main() -> Result<(), uuid::Error> { let my_uuid = Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8")?; println!("{}", my_uuid.to_urn()); Ok(()) } ``` To create a new random (V4) UUID and print it out in hexadecimal form: ```rust // Note that this requires the `v4` feature enabled in the uuid crate. use uuid::Uuid; fn main() { let my_uuid = Uuid::new_v4(); println!("{}", my_uuid); Ok(()) } ``` ## Strings Examples of string representations: * simple: `936DA01F9ABD4d9d80C702AF85C822A8` * hyphenated: `550e8400-e29b-41d4-a716-446655440000` * urn: `urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4` ## References * [Wikipedia: Universally Unique Identifier]( http://en.wikipedia.org/wiki/Universally_unique_identifier) * [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace]( http://tools.ietf.org/html/rfc4122) [`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen [`Uuid`]: https://docs.rs/uuid/0.8.2/uuid/struct.Uuid.html --- # License Licensed under either of * Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0) * MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT) at your option. [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid?ref=badge_large) ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/valuable/README.md # Valuable Valuable provides object-safe value inspection. Use cases include passing structured data to trait objects and object-safe serialization. ## License This project is licensed under the [MIT license](LICENSE). ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Valuable by you, shall be licensed as MIT, without any additional terms or conditions. ## Files: rust/vendor/vcpkg/README.md # vcpkg-rs [![Windows](https://github.com/mcgoo/vcpkg-rs/workflows/Windows/badge.svg?branch=master)](https://github.com/mcgoo/vcpkg-rs/actions?query=workflow%3AWindows) [![macOS](https://github.com/mcgoo/vcpkg-rs/workflows/macOS/badge.svg?branch=master)](https://github.com/mcgoo/vcpkg-rs/actions?query=workflow%3AmacOS) [![Linux](https://github.com/mcgoo/vcpkg-rs/workflows/Linux/badge.svg?branch=master)](https://github.com/mcgoo/vcpkg-rs/actions?query=workflow%3ALinux) [Documentation](https://docs.rs/vcpkg) [Changelog](CHANGELOG.md) This is a helper for finding libraries in a [Vcpkg](https://github.com/Microsoft/vcpkg) installation from cargo build scripts. It works similarly to [pkg-config](https://github.com/alexcrichton/pkg-config-rs). It works on Windows (MSVC ABI), Linux and MacOS. ## Example Find the library named `foo` in a [Vcpkg](https://github.com/Microsoft/vcpkg) installation and emit cargo metadata to link it: ```rust // build.rs fn main() { vcpkg::find_package("foo").unwrap(); } ``` See the crate [documentation](https://docs.rs/vcpkg) for more information. See [cargo-vcpkg](https://crates.io/crates/cargo-vcpkg) for a convenient way of creating a vcpkg installation. ## License See LICENSE-APACHE, and LICENSE-MIT for details. ## Files: rust/vendor/version_check/README.md # version\_check [![Build Status](https://github.com/SergioBenitez/version_check/workflows/CI/badge.svg)](https://github.com/SergioBenitez/version_check/actions) [![Current Crates.io Version](https://img.shields.io/crates/v/version_check.svg)](https://crates.io/crates/version_check) [![rustdocs on docs.rs](https://docs.rs/version_check/badge.svg)](https://docs.rs/version_check) This tiny crate checks that the running or installed `rustc` meets some version requirements. The version is queried by calling the Rust compiler with `--version`. The path to the compiler is determined first via the `RUSTC` environment variable. If it is not set, then `rustc` is used. If that fails, no determination is made, and calls return `None`. ## Usage Add to your `Cargo.toml` file, typically as a build dependency: ```toml [build-dependencies] version_check = "0.9" ``` `version_check` is compatible and compiles with Rust 1.0.0 and beyond. ## Examples Set a `cfg` flag in `build.rs` if the running compiler was determined to be at least version `1.13.0`: ```rust extern crate version_check as rustc; if rustc::is_min_version("1.13.0").unwrap_or(false) { println!("cargo:rustc-cfg=question_mark_operator"); } ``` Check that the running compiler was released on or after `2018-12-18`: ```rust extern crate version_check as rustc; match rustc::is_min_date("2018-12-18") { Some(true) => "Yep! It's recent!", Some(false) => "No, it's older.", None => "Couldn't determine the rustc version." }; ``` Check that the running compiler supports feature flags: ```rust extern crate version_check as rustc; match rustc::is_feature_flaggable() { Some(true) => "Yes! It's a dev or nightly release!", Some(false) => "No, it's stable or beta.", None => "Couldn't determine the rustc version." }; ``` See the [rustdocs](https://docs.rs/version_check) for more examples and complete documentation. ## Alternatives This crate is dead simple with no dependencies. If you need something more and don't care about panicking if the version cannot be obtained, or if you don't mind adding dependencies, see [rustc_version]. If you'd instead prefer a feature detection library that works by dynamically invoking `rustc` with a representative code sample, see [autocfg]. [rustc_version]: https://crates.io/crates/rustc_version [autocfg]: https://crates.io/crates/autocfg ## License `version_check` is licensed under either of the following, at your option: * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) ## Files: rust/vendor/wasi/README.md

    wasi

    A Bytecode Alliance project

    WASI API Bindings for Rust

    Crates.io version Download docs.rs docs

    This crate contains API bindings for [WASI](https://github.com/WebAssembly/WASI) system calls in Rust, and currently reflects the `wasi_snapshot_preview1` module. This crate is quite low-level and provides conceptually a "system call" interface. In most settings, it's better to use the Rust standard library, which has WASI support. The `wasi` crate is also entirely procedurally generated from the `*.witx` files describing the WASI apis. While some conveniences are provided the bindings here are intentionally low-level! # Usage First you can depend on this crate via `Cargo.toml`: ```toml [dependencies] wasi = "0.8.0" ``` Next you can use the APIs in the root of the module like so: ```rust fn main() { let stdout = 1; let message = "Hello, World!\n"; let data = [wasi::Ciovec { buf: message.as_ptr(), buf_len: message.len(), }]; wasi::fd_write(stdout, &data).unwrap(); } ``` Next you can use a tool like [`cargo wasi`](https://github.com/bytecodealliance/cargo-wasi) to compile and run your project: To compile Rust projects to wasm using WASI, use the `wasm32-wasi` target, like this: ``` $ cargo wasi run Compiling wasi v0.8.0+wasi-snapshot-preview1 Compiling wut v0.1.0 (/code) Finished dev [unoptimized + debuginfo] target(s) in 0.34s Running `/.cargo/bin/cargo-wasi target/wasm32-wasi/debug/wut.wasm` Running `target/wasm32-wasi/debug/wut.wasm` Hello, World! ``` # Development The bulk of the `wasi` crate is generated by the `witx-bindgen` tool, which lives at `crates/witx-bindgen` and is part of the cargo workspace. The `src/lib_generated.rs` file can be re-generated with the following command: ``` cargo run -p witx-bindgen -- crates/witx-bindgen/WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx > src/lib_generated.rs ``` Note that this uses the WASI standard repository as a submodule. If you do not have this submodule present in your source tree, run: ``` git submodule update --init ``` # License This project is licensed under the Apache 2.0 license with the LLVM exception. See [LICENSE](LICENSE) for more details. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions. ## Files: rust/vendor/widestring/README.md # widestring [![Crates.io](https://img.shields.io/crates/v/widestring.svg)](https://crates.io/crates/widestring/) [![docs.rs](https://docs.rs/widestring/badge.svg)](https://docs.rs/widestring/) [![Build status](https://ci.appveyor.com/api/projects/status/97pmbv6kk79bicww?svg=true)](https://ci.appveyor.com/project/starkat99/widestring-rs) [![Build Status](https://travis-ci.org/starkat99/widestring-rs.svg?branch=master)](https://travis-ci.org/starkat99/widestring-rs) A wide string Rust FFI library for converting to and from wide strings, such as those often used in Windows API or other FFI libaries. Both UTF-16 and UTF-32 types are provided, including support for malformed encoding. ## Documentation - [Crate API Reference](https://docs.rs/widestring/) - [Latest Changes](CHANGELOG.md) ### Optional Features - **`alloc`** - Enabled by default. Enable use of the [`alloc`](https://doc.rust-lang.org/alloc/) crate when not using the `std` library. This enables the `U16String`, `U32String`, `U16CString`, `U32CString` types and alises. - **`std`** - Enabled by default. Enable features that depend on the Rust `std` library, including everything in the `alloc` feature. ## License This library is distributed under the terms of either of: * MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)) * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)) at your option. ### Contributing Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/x509-parser/README.md [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT) [![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [![docs.rs](https://docs.rs/x509-parser/badge.svg)](https://docs.rs/x509-parser) [![crates.io](https://img.shields.io/crates/v/x509-parser.svg)](https://crates.io/crates/x509-parser) [![Download numbers](https://img.shields.io/crates/d/x509-parser.svg)](https://crates.io/crates/x509-parser) [![Github CI](https://github.com/rusticata/x509-parser/workflows/Continuous%20integration/badge.svg)](https://github.com/rusticata/x509-parser/actions) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.63.0+-lightgray.svg)](#rust-version-requirements) # X.509 Parser A X.509 v3 ([RFC5280]) parser, implemented with the [nom](https://github.com/Geal/nom) parser combinator framework. It is written in pure Rust, fast, and makes extensive use of zero-copy. A lot of care is taken to ensure security and safety of this crate, including design (recursion limit, defensive programming), tests, and fuzzing. It also aims to be panic-free. The code is available on [Github](https://github.com/rusticata/x509-parser) and is part of the [Rusticata](https://github.com/rusticata) project. Certificates are usually encoded in two main formats: PEM (usually the most common format) or DER. A PEM-encoded certificate is a container, storing a DER object. See the [`pem`](https://docs.rs/x509-parser/latest/x509_parser/pem/index.html) module for more documentation. To decode a DER-encoded certificate, the main parsing method is `X509Certificate::from_der` ( part of the [`FromDer`](https://docs.rs/x509-parser/latest/x509_parser/prelude/trait.FromDer.html) trait ), which builds a [`X509Certificate`](https://docs.rs/x509-parser/latest/x509_parser/certificate/struct.X509Certificate.html) object. An alternative method is to use [`X509CertificateParser`](https://docs.rs/x509-parser/latest/x509_parser/certificate/struct.X509CertificateParser.html), which allows specifying parsing options (for example, not automatically parsing option contents). The returned objects for parsers follow the definitions of the RFC. This means that accessing fields is done by accessing struct members recursively. Some helper functions are provided, for example [`X509Certificate::issuer()`](https://docs.rs/x509-parser/latest/x509_parser/certificate/struct.X509Certificate.html#method.issuer) returns the same as accessing `.tbs_certificate.issuer`. For PEM-encoded certificates, use the [`pem`](https://docs.rs/x509-parser/latest/x509_parser/pem/index.html) module. # Examples Parsing a certificate in DER format: ```rust use x509_parser::prelude::*; static IGCA_DER: &[u8] = include_bytes!("../assets/IGC_A.der"); let res = X509Certificate::from_der(IGCA_DER); match res { Ok((rem, cert)) => { assert!(rem.is_empty()); // assert_eq!(cert.version(), X509Version::V3); }, _ => panic!("x509 parsing failed: {:?}", res), } ``` To parse a CRL and print information about revoked certificates: ```rust # # let res = CertificateRevocationList::from_der(DER); match res { Ok((_rem, crl)) => { for revoked in crl.iter_revoked_certificates() { println!("Revoked certificate serial: {}", revoked.raw_serial_as_string()); println!(" Reason: {}", revoked.reason_code().unwrap_or_default().1); } }, _ => panic!("CRL parsing failed: {:?}", res), } ``` See also `examples/print-cert.rs`. # Features - The `verify` feature adds support for (cryptographic) signature verification, based on `ring`. It adds the [`X509Certificate::verify_signature()`](https://docs.rs/x509-parser/latest/x509_parser/certificate/struct.X509Certificate.html#method.verify_signature) to `X509Certificate`. ```rust /// Cryptographic signature verification: returns true if certificate was signed by issuer #[cfg(feature = "verify")] pub fn check_signature(cert: &X509Certificate<'_>, issuer: &X509Certificate<'_>) -> bool { let issuer_public_key = issuer.public_key(); cert .verify_signature(Some(issuer_public_key)) .is_ok() } ``` - The `validate` features add methods to run more validation functions on the certificate structure and values using the [`Validate`](https://docs.rs/x509-parser/latest/x509_parser/validate/trait.Validate.html) trait. It does not validate any cryptographic parameter (see `verify` above). ## Rust version requirements `x509-parser` requires **Rustc version 1.63 or greater**, based on der-parser dependencies and for proc-macro attributes support. Note that due to breaking changes in the `time` crate, a specific version of this crate must be specified for compiler versions <= 1.63: `cargo update -p time --precise 0.3.20` [RFC5280]: https://tools.ietf.org/html/rfc5280 ## Changes See [CHANGELOG.md](CHANGELOG.md) # License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ## Files: rust/vendor/zerocopy/README.md # zerocopy *Need more out of zerocopy? Submit a [customer request issue][customer-request-issue]!* ***Fast, safe, compile error. Pick two.*** Zerocopy makes zero-cost memory manipulation effortless. We write `unsafe` so you don't have to. *Thanks for using zerocopy 0.8! For an overview of what changes from 0.7, check out our [release notes][release-notes], which include a step-by-step guide for upgrading from 0.7.* *Have questions? Need help? Ask the maintainers on [GitHub][github-q-a] or on [Discord][discord]!* [customer-request-issue]: https://github.com/google/zerocopy/issues/new/choose [release-notes]: https://github.com/google/zerocopy/discussions/1680 [github-q-a]: https://github.com/google/zerocopy/discussions/categories/q-a [discord]: https://discord.gg/MAvWH2R6zk ## Overview ###### Conversion Traits Zerocopy provides four derivable traits for zero-cost conversions: - `TryFromBytes` indicates that a type may safely be converted from certain byte sequences (conditional on runtime checks) - `FromZeros` indicates that a sequence of zero bytes represents a valid instance of a type - `FromBytes` indicates that a type may safely be converted from an arbitrary byte sequence - `IntoBytes` indicates that a type may safely be converted *to* a byte sequence These traits support sized types, slices, and [slice DSTs][slice-dsts]. [slice-dsts]: KnownLayout#dynamically-sized-types ###### Marker Traits Zerocopy provides three derivable marker traits that do not provide any functionality themselves, but are required to call certain methods provided by the conversion traits: - `KnownLayout` indicates that zerocopy can reason about certain layout qualities of a type - `Immutable` indicates that a type is free from interior mutability, except by ownership or an exclusive (`&mut`) borrow - `Unaligned` indicates that a type's alignment requirement is 1 You should generally derive these marker traits whenever possible. ###### Conversion Macros Zerocopy provides six macros for safe casting between types: - (`try_`[try_transmute])`transmute` (conditionally) converts a value of one type to a value of another type of the same size - (`try_`[try_transmute_mut])`transmute_mut` (conditionally) converts a mutable reference of one type to a mutable reference of another type of the same size - (`try_`[try_transmute_ref])`transmute_ref` (conditionally) converts a mutable or immutable reference of one type to an immutable reference of another type of the same size These macros perform *compile-time* size and alignment checks, meaning that unconditional casts have zero cost at runtime. Conditional casts do not need to validate size or alignment runtime, but do need to validate contents. These macros cannot be used in generic contexts. For generic conversions, use the methods defined by the [conversion traits](#conversion-traits). ###### Byteorder-Aware Numerics Zerocopy provides byte-order aware integer types that support these conversions; see the `byteorder` module. These types are especially useful for network parsing. ## Cargo Features - **`alloc`** By default, `zerocopy` is `no_std`. When the `alloc` feature is enabled, the `alloc` crate is added as a dependency, and some allocation-related functionality is added. - **`std`** By default, `zerocopy` is `no_std`. When the `std` feature is enabled, the `std` crate is added as a dependency (ie, `no_std` is disabled), and support for some `std` types is added. `std` implies `alloc`. - **`derive`** Provides derives for the core marker traits via the `zerocopy-derive` crate. These derives are re-exported from `zerocopy`, so it is not necessary to depend on `zerocopy-derive` directly. However, you may experience better compile times if you instead directly depend on both `zerocopy` and `zerocopy-derive` in your `Cargo.toml`, since doing so will allow Rust to compile these crates in parallel. To do so, do *not* enable the `derive` feature, and list both dependencies in your `Cargo.toml` with the same leading non-zero version number; e.g: ```toml [dependencies] zerocopy = "0.X" zerocopy-derive = "0.X" ``` To avoid the risk of [duplicate import errors][duplicate-import-errors] if one of your dependencies enables zerocopy's `derive` feature, import derives as `use zerocopy_derive::*` rather than by name (e.g., `use zerocopy_derive::FromBytes`). - **`simd`** When the `simd` feature is enabled, `FromZeros`, `FromBytes`, and `IntoBytes` impls are emitted for all stable SIMD types which exist on the target platform. Note that the layout of SIMD types is not yet stabilized, so these impls may be removed in the future if layout changes make them invalid. For more information, see the Unsafe Code Guidelines Reference page on the [layout of packed SIMD vectors][simd-layout]. - **`simd-nightly`** Enables the `simd` feature and adds support for SIMD types which are only available on nightly. Since these types are unstable, support for any type may be removed at any point in the future. - **`float-nightly`** Adds support for the unstable `f16` and `f128` types. These types are not yet fully implemented and may not be supported on all platforms. [duplicate-import-errors]: https://github.com/google/zerocopy/issues/1587 [simd-layout]: https://rust-lang.github.io/unsafe-code-guidelines/layout/packed-simd-vectors.html ## Security Ethos Zerocopy is expressly designed for use in security-critical contexts. We strive to ensure that that zerocopy code is sound under Rust's current memory model, and *any future memory model*. We ensure this by: - **...not 'guessing' about Rust's semantics.** We annotate `unsafe` code with a precise rationale for its soundness that cites a relevant section of Rust's official documentation. When Rust's documented semantics are unclear, we work with the Rust Operational Semantics Team to clarify Rust's documentation. - **...rigorously testing our implementation.** We run tests using [Miri], ensuring that zerocopy is sound across a wide array of supported target platforms of varying endianness and pointer width, and across both current and experimental memory models of Rust. - **...formally proving the correctness of our implementation.** We apply formal verification tools like [Kani][kani] to prove zerocopy's correctness. For more information, see our full [soundness policy]. [Miri]: https://github.com/rust-lang/miri [Kani]: https://github.com/model-checking/kani [soundness policy]: https://github.com/google/zerocopy/blob/main/POLICIES.md#soundness ## Relationship to Project Safe Transmute [Project Safe Transmute] is an official initiative of the Rust Project to develop language-level support for safer transmutation. The Project consults with crates like zerocopy to identify aspects of safer transmutation that would benefit from compiler support, and has developed an [experimental, compiler-supported analysis][mcp-transmutability] which determines whether, for a given type, any value of that type may be soundly transmuted into another type. Once this functionality is sufficiently mature, zerocopy intends to replace its internal transmutability analysis (implemented by our custom derives) with the compiler-supported one. This change will likely be an implementation detail that is invisible to zerocopy's users. Project Safe Transmute will not replace the need for most of zerocopy's higher-level abstractions. The experimental compiler analysis is a tool for checking the soundness of `unsafe` code, not a tool to avoid writing `unsafe` code altogether. For the foreseeable future, crates like zerocopy will still be required in order to provide higher-level abstractions on top of the building block provided by Project Safe Transmute. [Project Safe Transmute]: https://rust-lang.github.io/rfcs/2835-project-safe-transmute.html [mcp-transmutability]: https://github.com/rust-lang/compiler-team/issues/411 ## MSRV See our [MSRV policy]. [MSRV policy]: https://github.com/google/zerocopy/blob/main/POLICIES.md#msrv ## Changelog Zerocopy uses [GitHub Releases]. [GitHub Releases]: https://github.com/google/zerocopy/releases ## Thanks Zerocopy is maintained by engineers at Google and Amazon with help from [many wonderful contributors][contributors]. Thank you to everyone who has lent a hand in making Rust a little more secure! [contributors]: https://github.com/google/zerocopy/graphs/contributors ## Disclaimer Disclaimer: Zerocopy is not an officially supported Google product. ## Files: suricata-update/suricata/update/compat/argparse/LICENSE.txt argparse is (c) 2006-2009 Steven J. Bethard . The argparse module was contributed to Python as of Python 2.7 and thus was licensed under the Python license. Same license applies to all files in the argparse package project. For details about the Python License, please see doc/Python-License.txt. History ------- Before (and including) argparse 1.1, the argparse package was licensed under Apache License v2.0. After argparse 1.1, all project files from the argparse project were deleted due to license compatibility issues between Apache License 2.0 and GNU GPL v2. The project repository then had a clean start with some files taken from Python 2.7.1, so definitely all files are under Python License now. ## Files: rust/vendor/suricata-lua-sys/lua/lua.h Copyright (C) 1994-2025 Lua.org, PUC-Rio. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: suricata-update/suricata/update/compat/ordereddict.py Copyright (c) 2009 Raymond Hettinger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Files: rust/htp/src/test/files/generate-gzip-tests.php Copyright (c) 2009-2010 Open Information Security Foundation Copyright (c) 2010-2013 Qualys, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Qualys, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: src/app-layer-modbus.c src/app-layer-modbus.h src/detect-modbus.c src/detect-modbus.h src/detect-tls.c src/detect-tls.h src/util-strlcatu.c src/util-strlcpyu.c Copyright (C) 2011-2012 ANSSI Copyright (C) 2014 ANSSI Copyright (C) 2022 Open Information Security Foundation Copyright (c) 1998 Todd C. Miller All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: src/interval-tree.h src/tree.h SPDX-License-Identifier: BSD-2-Clause-FreeBSD Copyright 2002 Niels Provos All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: src/queue.h Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @(#)queue.h 8.5 (Berkeley) 8/20/94 ## Files: src/util-fix_checksum.c src/util-fix_checksum.h Reference: OpenBSD's pf.c. Copyright (c) 2001 Daniel Hartmeier Copyright (c) 2002 - 2008 Henning Brauer All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Effort sponsored in part by the Defense Advanced Research Projects Agency (DARPA) and Air Force Research Laboratory, Air Force Materiel Command, USAF, under agreement number F30602-01-2-0537. ## Files: src/util-strptime.c Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. All rights reserved. This code was contributed to The NetBSD Foundation by Klaus Klein. Heavily optimised by David Laight Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Files: src/win32-syslog.h Copyright (c) 1982, 1986, 1988, 1993 The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @(#)syslog.h 8.1 (Berkeley) 6/2/93 ## Files: doc/userguide/conf.py suricata-update/doc/conf.py If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. html_show_copyright = True ## Files: ebpf/bypass_filter.c ebpf/filter.c ebpf/lb.c ebpf/vlan_filter.c ebpf/xdp_filter.c src/decode-vxlan.h src/detect-datarep.h src/detect-dataset.h src/detect-tls-ja3s-hash.h src/detect-tls-ja3s-string.h src/output-filestore.h src/runmode-windivert.c src/runmode-windivert.h src/source-windivert-prototypes.h src/source-windivert.c src/source-windivert.h src/util-bpf.c src/util-bpf.h src/util-ebpf.h src/win32-syscall.c src/win32-syscall.h suricata-update/suricata/update/notes.py suricata-update/tests/test_matchers.py Copyright (C) 2018 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: ebpf/include/linux/bpf.h SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note ## Files: ebpf/include/linux/bpf.h Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. ## Files: ebpf/xdp_lb.c rust/dist/rust-bindings.h src/detect-sip-method.c src/detect-sip-method.h src/detect-sip-uri.c src/detect-sip-uri.h src/detect-tls-certs.h src/detect-tls-ja3s-hash.c src/detect-tls-ja3s-string.c src/feature.c src/feature.h src/output-json-anomaly.h src/output-json-ftp.h src/tests/app-layer-htp-file.c src/tests/detect-tls-cert-fingerprint.c src/tests/detect-tls-cert-serial.c src/tests/detect-tls-certs.c src/tests/reputation.c suricata-update/suricata/update/commands/checkversions.py Copyright (C) 2019 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: examples/lib/custom/main.c examples/lib/simple/main.c examples/plugins/ci-capture/plugin.c examples/plugins/ci-capture/runmode.c examples/plugins/ci-capture/runmode.h examples/plugins/ci-capture/source.c examples/plugins/ci-capture/source.h src/app-layer-htp-range.c src/app-layer-htp-range.h src/app-layer-imap.c src/app-layer-imap.h src/datasets-context-json.h src/decode-arp.c src/decode-arp.h src/detect-dns-response.h src/detect-entropy.h src/detect-tls-alpn.c src/detect-tls-alpn.h src/detect-tls-subjectaltname.c src/detect-tls-subjectaltname.h src/detect-transform-luaxform.c src/detect-transform-luaxform.h src/detect-vlan.c src/detect-vlan.h src/flow-callbacks.c src/flow-callbacks.h src/log-flush.c src/log-flush.h src/output-eve.c src/output-eve.h src/output-json-arp.c src/output-json-arp.h src/tests/output-json-stats.c src/thread-callbacks.c src/thread-callbacks.h src/thread-storage.c src/thread-storage.h src/util-mpm-hs-cache.h src/util-port-interval-tree.c src/util-port-interval-tree.h Copyright (C) 2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: examples/plugins/c-custom-loggers/custom-logger.c src/output-eve-stream.c src/runmode-lib.c src/runmode-lib.h src/source-lib.c src/source-lib.h src/util-lua-sandbox.c src/util-lua-sandbox.h Copyright (C) 2023-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: examples/plugins/c-json-filetype/filetype.c plugins/napatech/plugin.c plugins/pfring/plugin.c src/detect-base64-decode.c Copyright (C) 2020-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: ltmain.sh Copyright (C) 1996-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## Files: ltmain.sh GNU Libtool is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libtool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ## Files: ltmain.sh Copyright (C) 2004-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## Files: ltmain.sh This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. ## Files: ltmain.sh As a special exception to the GNU General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. ## Files: ltmain.sh This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ## Files: ltmain.sh You should have received a copy of the GNU General Public License along with this program. If not, see . ## Files: ltmain.sh Copyright (C) 2010-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## Files: ltmain.sh This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ## Files: ltmain.sh This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ## Files: ltmain.sh You should have received a copy of the GNU General Public License along with this program. If not, see . ## Files: plugins/napatech/runmode-napatech.c plugins/napatech/runmode-napatech.h plugins/napatech/source-napatech.h Copyright (C) 2012-2017 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: plugins/napatech/source-napatech.c src/decode-teredo.h src/detect-pkt-data.c Copyright (C) 2012-2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: plugins/napatech/util-napatech.c src/app-layer-expectation.c src/app-layer-expectation.h src/app-layer-smb.c src/output-json-dcerpc.c src/output-json-ftp.c src/output-json-smb.c Copyright (C) 2017-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: plugins/napatech/util-napatech.h src/app-layer-nfs-tcp.h src/app-layer-nfs-udp.h src/app-layer-register.h src/app-layer-smb.h src/app-layer-tftp.h src/datasets.h src/detect-ftpdata.h src/detect-nfs-procedure.h src/detect-nfs-version.h src/detect-smb-share.c src/detect-smb-share.h src/detect-target.h src/detect-tls-cert-fingerprint.h src/detect-tls-cert-serial.h src/detect-tls-ja3-hash.c src/detect-tls-ja3-hash.h src/detect-tls-ja3-string.c src/detect-tls-ja3-string.h src/output-json-dcerpc.h src/output-json-smb.h src/rust-context.h src/rust.h src/tests/detect-http-server-body.c src/util-detect.c src/util-detect.h src/util-file-decompression.c src/util-file-decompression.h src/util-file-swf-decompression.c src/util-file-swf-decompression.h src/util-lua-ja3.c src/util-lua-ja3.h suricata-update/suricata/update/commands/__init__.py suricata-update/suricata/update/commands/addsource.py suricata-update/suricata/update/commands/disablesource.py suricata-update/suricata/update/commands/enablesource.py suricata-update/suricata/update/commands/listsources.py suricata-update/suricata/update/commands/removesource.py suricata-update/suricata/update/commands/updatesources.py suricata-update/suricata/update/configs/__init__.py suricata-update/suricata/update/exceptions.py suricata-update/suricata/update/matchers.py suricata-update/suricata/update/sources.py suricata-update/tests/test_classificationmap.py suricata-update/tests/test_signaturemap.py Copyright (C) 2017 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: plugins/ndpi/ndpi.c src/util-exception-policy-types.h Copyright (C) 2024-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: plugins/ndpi/ndpi.c License note: While this "glue" code to the nDPI library is GPLv2, nDPI is itself LGPLv3 which is known to be incompatible with the GPLv2. ## Files: plugins/pfring/runmode-pfring.c src/detect-dce-stub-data.c src/detect-http-cookie.c src/detect-http-stat-code.c src/detect-http-stat-msg.c src/detect-http-ua.c src/detect-http-uri.c src/detect-rawbytes.c src/detect-template2.h src/tests/detect-http-header.c src/tests/detect-http-uri.c src/tests/detect-ipv4hdr.c src/tests/detect-ipv6hdr.c src/tests/detect-tcphdr.c src/tests/detect-ttl.c src/tests/detect-udphdr.c Copyright (C) 2007-2018 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: plugins/pfring/runmode-pfring.h plugins/pfring/source-pfring.h src/action-globals.h src/conf-yaml-loader.h src/decode-erspan.h src/decode-gre.h src/decode-icmpv6.c src/decode-ppp.h src/decode-pppoe.h src/decode-raw.h src/decode-sll.h src/detect-classtype.h src/detect-dce-iface.h src/detect-dce-opnum.h src/detect-dce-stub-data.h src/detect-depth.h src/detect-detection-filter.h src/detect-distance.h src/detect-engine-address-ipv4.c src/detect-engine-address-ipv4.h src/detect-engine-address-ipv6.c src/detect-engine-address-ipv6.h src/detect-engine-dcepayload.c src/detect-engine-dcepayload.h src/detect-engine-event.h src/detect-engine-mpm.h src/detect-engine-payload.h src/detect-engine-port.h src/detect-engine-siggroup.h src/detect-engine-sigorder.h src/detect-engine-tag.h src/detect-flow.h src/detect-fragbits.h src/detect-fragoffset.h src/detect-ftpbounce.c src/detect-ftpbounce.h src/detect-gid.h src/detect-http-client-body.h src/detect-http-cookie.h src/detect-http-header.h src/detect-http-method.h src/detect-http-raw-header.h src/detect-http-server-body.h src/detect-http-stat-code.h src/detect-http-stat-msg.h src/detect-http-uri.h src/detect-icmp-id.h src/detect-icmp-seq.h src/detect-icode.h src/detect-id.h src/detect-ipopts.h src/detect-ipproto.h src/detect-isdataat.h src/detect-itype.h src/detect-metadata.h src/detect-msg.c src/detect-msg.h src/detect-noalert.h src/detect-nocase.c src/detect-nocase.h src/detect-offset.h src/detect-pktvar.h src/detect-priority.h src/detect-rawbytes.h src/detect-rev.c src/detect-rev.h src/detect-rpc.h src/detect-sameip.h src/detect-sid.h src/detect-ssh-proto-version.h src/detect-ssh-software-version.h src/detect-ssl-state.h src/detect-ssl-version.h src/detect-stream_size.h src/detect-tcp-ack.h src/detect-tcp-flags.h src/detect-tcp-seq.c src/detect-tcp-seq.h src/detect-tcp-window.h src/detect-tls-version.h src/detect-tos.h src/detect-ttl.h src/detect-uricontent.h src/detect-urilen.h src/detect-within.h src/flow-bit.h src/flow-var.c src/host-bit.h src/ippair-bit.h src/log-httplog.h src/log-tcp-data.h src/output-json-flow.h src/output-json-http.h src/output-json-smtp.h src/runmode-erf-dag.c src/runmode-erf-dag.h src/runmode-erf-file.c src/runmode-erf-file.h src/runmode-ipfw.h src/runmode-nfq.h src/runmode-pcap-file.c src/runmode-pcap-file.h src/runmode-pcap.h src/source-nfq-prototypes.h src/source-nfq.h src/source-pcap-file-directory-helper.h src/source-pcap-file.h src/stream-tcp-private.h src/tests/detect-http-method.c src/threads.c src/tm-queuehandlers.c src/tm-queuehandlers.h src/tm-queues.h src/tmqh-flow.h src/tmqh-simple.h src/util-action.h src/util-byte.c src/util-cidr.h src/util-classification-config.c src/util-classification-config.h src/util-clock.h src/util-coredump-config.c src/util-cpu.h src/util-daemon.c src/util-daemon.h src/util-debug-filters.h src/util-enum.c src/util-enum.h src/util-fmemopen.c src/util-fmemopen.h src/util-hash.c src/util-hash.h src/util-hashlist.c src/util-hashlist.h src/util-memcmp.c src/util-memrchr.h src/util-optimize.h src/util-pidfile.c src/util-pidfile.h src/util-pool.c src/util-pool.h src/util-print.h src/util-privs.c src/util-privs.h src/util-reference-config.h src/util-rule-vars.c src/util-rule-vars.h src/util-spm-bm.h src/util-spm-bs.c src/util-spm-bs.h src/util-spm-bs2bm.c src/util-spm-bs2bm.h src/util-syslog.h src/util-threshold-config.h src/util-unittest-helper.h src/util-unittest.c src/util-validate.h src/win32-misc.c src/win32-misc.h src/win32-service.c src/win32-service.h Copyright (C) 2007-2010 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: plugins/pfring/source-pfring.c src/detect-depth.c src/detect-engine-port.c src/detect-http-headers-stub.h src/detect-http-host.c src/detect-http-location.c src/detect-http-location.h src/detect-http-method.c src/detect-http-server.c src/detect-http-server.h src/detect-ipv4hdr.c src/detect-ipv4hdr.h src/detect-ipv6hdr.c src/detect-ipv6hdr.h src/detect-offset.c src/detect-tcp-wscale.h src/detect-tcphdr.c src/detect-tcphdr.h src/detect-tcpmss.h src/detect-udphdr.c src/detect-udphdr.h src/packet-queue.c src/packet-queue.h src/source-pcap.c src/source-pcap.h src/tests/detect-ssl-state.c src/tests/detect-ssl-version.c src/tests/detect-tls-cert-issuer.c src/tests/detect-tls-cert-subject.c src/tests/detect-tls-version.c src/tm-queues.c Copyright (C) 2007-2019 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: rust/vendor/libz-sys/src/zlib-ng/adler32.c rust/vendor/libz-sys/src/zlib-ng/arch/generic/adler32_c.c rust/vendor/libz-sys/src/zlib/adler32.c adler32.c -- compute the Adler-32 checksum of a data stream Copyright (C) 1995-2011, 2016 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/compress.c rust/vendor/libz-sys/src/zlib/compress.c compress.c -- compress a memory buffer Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/crc32.c rust/vendor/libz-sys/src/zlib/crc32.c crc32.c -- compute the CRC-32 of a data stream Copyright (C) 1995-2022 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h This interleaved implementation of a CRC makes use of pipelined multiple arithmetic-logic units, commonly found in modern CPU cores. It is due to Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution. ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate.c rust/vendor/libz-sys/src/zlib/deflate.c deflate.c -- compress data using the deflation algorithm Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate.c rust/vendor/libz-sys/src/zlib-ng/inftrees.c rust/vendor/libz-sys/src/zlib/deflate.c rust/vendor/libz-sys/src/zlib/inftrees.c If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot include such an acknowledgment, I would appreciate that you keep this copyright string in the executable of your product. ## Files: rust/vendor/libz-sys/src/zlib/deflate.h deflate.h -- internal compression state Copyright (C) 1995-2024 Jean-loup Gailly For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib/gzclose.c gzclose.c -- zlib gzclose() function Copyright (C) 2004, 2010 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/gzguts.h rust/vendor/libz-sys/src/zlib/gzguts.h gzguts.h -- zlib internal header definitions for gz* operations Copyright (C) 2004-2024 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/gzlib.c rust/vendor/libz-sys/src/zlib/gzlib.c gzlib.c -- zlib functions common to reading and writing gzip files Copyright (C) 2004-2024 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib/gzread.c gzread.c -- zlib functions for reading gzip files Copyright (C) 2004-2017 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/gzwrite.c rust/vendor/libz-sys/src/zlib/gzwrite.c gzwrite.c -- zlib functions for writing gzip files Copyright (C) 2004-2019 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/infback.c rust/vendor/libz-sys/src/zlib/infback.c infback.c -- inflate using a call-back interface Copyright (C) 1995-2022 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/inffast_tpl.h rust/vendor/libz-sys/src/zlib/inffast.c inffast.c -- fast decoding Copyright (C) 1995-2017 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib/inffast.h inffast.h -- header to use inffast.c Copyright (C) 1995-2003, 2010 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/inflate.c rust/vendor/libz-sys/src/zlib/inflate.c inflate.c -- zlib decompression Copyright (C) 1995-2022 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/inflate.h rust/vendor/libz-sys/src/zlib/inflate.h inflate.h -- internal inflate state definition Copyright (C) 1995-2019 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/inftrees.c rust/vendor/libz-sys/src/zlib/inftrees.c inftrees.c -- generate Huffman trees for efficient decoding Copyright (C) 1995-2024 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib/inftrees.h inftrees.h -- header to use inftrees.c Copyright (C) 1995-2005, 2010 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/trees.c rust/vendor/libz-sys/src/zlib/trees.c trees.c -- output deflated data using Huffman coding Copyright (C) 1995-2024 Jean-loup Gailly detect_data_type() function provided freely by Cosmin Truta, 2006 For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib/uncompr.c uncompr.c -- decompress a memory buffer Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib/zconf.h zconf.h -- configuration of the zlib compression library Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib/zlib.h zlib.h -- interface of the 'zlib' general purpose compression library version 1.3.1, January 22nd, 2024 Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). ## Files: rust/vendor/libz-sys/src/zlib-ng/zutil.c rust/vendor/libz-sys/src/zlib/zutil.c zutil.c -- target dependent utility functions for the compression library Copyright (C) 1995-2017 Jean-loup Gailly For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/zutil.h rust/vendor/libz-sys/src/zlib/zutil.h zutil.h -- internal interface and configuration of the compression library Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/adler32_p.h adler32_p.h -- Private inline functions and macros shared with different computation of the Adler-32 checksum of a data stream. Copyright (C) 1995-2011, 2016 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/adler32_neon.c Copyright (C) 1995-2011, 2016 Mark Adler Copyright (C) 2017 ARM Holdings Inc. Authors: Adenilson Cavalcanti Adam Stylinski For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/arm_features.h arm_features.h -- check for ARM features. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/arm_functions.h arm_functions.h -- ARM implementations for arch-specific functions. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/chunkset_neon.c chunkset_neon.c -- NEON inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/compare256_neon.c compare256_neon.c - NEON version of compare256 Copyright (C) 2022 Nathan Moinvaziri For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/crc32_acle.c crc32_acle.c -- compute the CRC-32 of a data stream Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler Copyright (C) 2016 Yang Zhang For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/slide_hash_armv6.c slide_hash_armv6.c -- Optimized hash table shifting for ARMv6 with support for SIMD instructions Copyright (C) 2023 Cameron Cawley For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/arm/slide_hash_neon.c slide_hash_neon.c -- Optimized hash table shifting for ARM with support for NEON instructions Copyright (C) 2017-2020 Mika T. Lindqvist Authors: Mika T. Lindqvist Jun He For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/adler32_fold_c.c adler32_fold.c -- adler32 folding interface Copyright (C) 2022 Adam Stylinski For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/chunk_permute_table.h chunk_permute_table.h - shared AVX/SSSE3 permutation table for use with chunkmemset family of functions. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/chunkset_c.c chunkset.c -- inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/compare256_c.c compare256.c -- 256 byte memory comparison with match length return Copyright (C) 2020 Nathan Moinvaziri For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/compare256_p.h compare256_p.h -- 256 byte memory comparison with match length return Copyright (C) 2020 Nathan Moinvaziri For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/crc32_braid_c.c crc32_braid.c -- compute the CRC-32 of a data stream Copyright (C) 1995-2022 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h This interleaved implementation of a CRC makes use of pipelined multiple arithmetic-logic units, commonly found in modern CPU cores. It is due to Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution. ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/crc32_fold_c.c crc32_fold.c -- crc32 folding interface Copyright (C) 2021 Nathan Moinvaziri For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/generic_functions.h generic_functions.h -- generic C implementations for arch-specific functions. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/generic/slide_hash_c.c slide_hash.c -- slide hash table C implementation Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/adler32_power8.c Adler32 for POWER8 using VSX instructions. Copyright (C) 2020 IBM Corporation Author: Rogerio Alves For conditions of distribution and use, see copyright notice in zlib.h Calculate adler32 checksum for 16 bytes at once using POWER8+ VSX (vector) instructions. If adler32 do 1 byte at time on the first iteration s1 is s1_0 (_n means iteration n) is the initial value of adler - at start _0 is 1 unless adler initial value is different than 1. So s1_1 = s1_0 + c[0] after the first calculation. For the iteration s1_2 = s1_1 + c[1] and so on. Hence, for iteration N, s1_N = s1_(N-1) + c[N] is the value of s1 on after iteration N. Therefore, for s2 and iteration N, s2_N = s2_0 + N*s1_N + N*c[0] + N-1*c[1] + ... + c[N] In a more general way: s1_N = s1_0 + sum(i=1 to N)c[i] s2_N = s2_0 + N*s1 + sum (i=1 to N)(N-i+1)*c[i] Where s1_N, s2_N are the values for s1, s2 after N iterations. So if we can process N-bit at time we can do this at once. Since VSX can support 16-bit vector instructions, we can process 16-bit at time using N = 16 we have: s1 = s1_16 = s1_(16-1) + c[16] = s1_0 + sum(i=1 to 16)c[i] s2 = s2_16 = s2_0 + 16*s1 + sum(i=1 to 16)(16-i+1)*c[i] After the first iteration we calculate the adler32 checksum for 16 bytes. For more background about adler32 please check the RFC: https://www.ietf.org/rfc/rfc1950.txt ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/adler32_vmx.c adler32_vmx.c -- compute the Adler-32 checksum of a data stream Copyright (C) 1995-2011 Mark Adler Copyright (C) 2017-2023 Mika T. Lindqvist Copyright (C) 2021 Adam Stylinski For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/chunkset_power8.c chunkset_power8.c -- VSX inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/compare256_power9.c compare256_power9.c - Power9 version of compare256 Copyright (C) 2019 Matheus Castanho , IBM For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/crc32_constants.h Constants table used by crc32_power8.c Copyright (C) 2021 IBM Corporation This file was automatically generated, DO NOT EDIT IT MANUALLY. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/crc32_power8.c crc32 for POWER8 using VSX instructions Copyright (C) 2021 IBM Corporation Author: Rogerio Alves For conditions of distribution and use, see copyright notice in zlib.h Calculate the checksum of data that is 16 byte aligned and a multiple of 16 bytes. The first step is to reduce it to 1024 bits. We do this in 8 parallel chunks in order to mask the latency of the vpmsum instructions. If we have more than 32 kB of data to checksum we repeat this step multiple times, passing in the previous 1024 bits. The next step is to reduce the 1024 bits to 64 bits. This step adds 32 bits of 0s to the end - this matches what a CRC does. We just calculate constants that land the data in this 32 bits. We then use fixed point Barrett reduction to compute a mod n over GF(2) for n = CRC using POWER8 instructions. We use x = 32. http://en.wikipedia.org/wiki/Barrett_reduction This code uses gcc vector builtins instead using assembly directly. ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/power_features.c power_features.c - POWER feature check Copyright (C) 2020 Matheus Castanho , IBM Copyright (C) 2021-2024 Mika T. Lindqvist For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/power_features.h power_features.h -- check for POWER CPU features Copyright (C) 2020 Matheus Castanho , IBM Copyright (C) 2021 Mika T. Lindqvist For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/power_functions.h power_functions.h -- POWER implementations for arch-specific functions. Copyright (C) 2020 Matheus Castanho , IBM Copyright (C) 2021 Mika T. Lindqvist For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/power_intrins.h Helper functions to work around issues with clang builtins Copyright (C) 2021 IBM Corporation Authors: Daniel Black Rogerio Alves Tulio Magno Quites Machado Filho For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/slide_hash_power8.c Optimized slide_hash for POWER processors Copyright (C) 2019-2020 IBM Corporation Author: Matheus Castanho For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/slide_hash_vmx.c Optimized slide_hash for PowerPC processors with VMX instructions Copyright (C) 2017-2021 Mika T. Lindqvist For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/power/slide_ppc_tpl.h Optimized slide_hash for PowerPC processors Copyright (C) 2017-2021 Mika T. Lindqvist For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/riscv/adler32_rvv.c adler32_rvv.c - RVV version of adler32 Copyright (C) 2023 SiFive, Inc. All rights reserved. Contributed by Alex Chiang For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/riscv/chunkset_rvv.c chunkset_rvv.c - RVV version of chunkset Copyright (C) 2023 SiFive, Inc. All rights reserved. Contributed by Alex Chiang For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/riscv/compare256_rvv.c compare256_rvv.c - RVV version of compare256 Copyright (C) 2023 SiFive, Inc. All rights reserved. Contributed by Alex Chiang For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/riscv/riscv_features.h riscv_features.h -- check for riscv features. Copyright (C) 2023 SiFive, Inc. All rights reserved. Contributed by Alex Chiang For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/riscv/riscv_functions.h riscv_functions.h -- RISCV implementations for arch-specific functions. Copyright (C) 2023 SiFive, Inc. All rights reserved. Contributed by Alex Chiang For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/riscv/slide_hash_rvv.c slide_hash_rvv.c - RVV version of slide_hash Copyright (C) 2023 SiFive, Inc. All rights reserved. Contributed by Alex Chiang For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/s390/crc32-vx.c Hardware-accelerated CRC-32 variants for Linux on z Systems Use the z/Architecture Vector Extension Facility to accelerate the computing of bitreflected CRC-32 checksums. This CRC-32 implementation algorithm is bitreflected and processes the least-significant bit first (Little-Endian). This code was originally written by Hendrik Brueckner for use in the Linux kernel and has been relicensed under the zlib license. ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/s390/s390_features.h s390_features.h -- check for s390 features. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/s390/s390_functions.h s390_functions.h -- s390 implementations for arch-specific functions. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/adler32_avx2.c adler32_avx2.c -- compute the Adler-32 checksum of a data stream Copyright (C) 1995-2011 Mark Adler Copyright (C) 2022 Adam Stylinski Authors: Brian Bockelman Adam Stylinski For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/adler32_avx2_p.h adler32_avx2_p.h -- adler32 avx2 utility functions Copyright (C) 2022 Adam Stylinski For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/adler32_avx512.c adler32_avx512.c -- compute the Adler-32 checksum of a data stream Copyright (C) 1995-2011 Mark Adler Authors: Adam Stylinski Brian Bockelman For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/adler32_avx512_vnni.c adler32_avx512_vnni.c -- compute the Adler-32 checksum of a data stream Based on Brian Bockelman's AVX2 version Copyright (C) 1995-2011 Mark Adler Authors: Adam Stylinski Brian Bockelman For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/adler32_sse42.c adler32_sse42.c -- compute the Adler-32 checksum of a data stream Copyright (C) 1995-2011 Mark Adler Authors: Adam Stylinski Brian Bockelman For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/adler32_ssse3.c adler32_ssse3.c -- compute the Adler-32 checksum of a data stream Copyright (C) 1995-2011 Mark Adler Authors: Adam Stylinski Brian Bockelman For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/adler32_ssse3_p.h adler32_ssse3_p.h -- adler32 ssse3 utility functions Copyright (C) 2022 Adam Stylinski For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/chunkset_avx2.c chunkset_avx2.c -- AVX2 inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/chunkset_avx512.c chunkset_avx512.c -- AVX512 inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/chunkset_sse2.c chunkset_sse2.c -- SSE2 inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/chunkset_ssse3.c chunkset_ssse3.c -- SSSE3 inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/compare256_avx2.c compare256_avx2.c -- AVX2 version of compare256 Copyright Mika T. Lindqvist For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/compare256_sse2.c compare256_sse2.c -- SSE2 version of compare256 Copyright Adam Stylinski For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/crc32_fold_pclmulqdq_tpl.h rust/vendor/libz-sys/src/zlib-ng/arch/x86/crc32_pclmulqdq.c rust/vendor/libz-sys/src/zlib-ng/arch/x86/crc32_pclmulqdq_tpl.h Compute the CRC32 using a parallelized folding approach with the PCLMULQDQ instruction. A white paper describing this algorithm can be found at: doc/crc-pclmulqdq.pdf Copyright (C) 2013 Intel Corporation. All rights reserved. Copyright (C) 2016 Marian Beermann (support for initial value) Authors: Wajdi Feghali Jim Guilford Vinodh Gopal Erdinc Ozturk Jim Kukunas For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/crc32_fold_vpclmulqdq_tpl.h crc32_fold_vpclmulqdq_tpl.h -- VPCMULQDQ-based CRC32 folding template. Copyright Wangyang Guo (wangyang.guo@intel.com) For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/crc32_vpclmulqdq.c crc32_vpclmulqdq.c -- VPCMULQDQ-based CRC32 folding implementation. Copyright Wangyang Guo (wangyang.guo@intel.com) For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/slide_hash_avx2.c AVX2 optimized hash slide, based on Intel's slide_sse implementation Copyright (C) 2017 Intel Corporation Authors: Arjan van de Ven Jim Kukunas Mika T. Lindqvist For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/slide_hash_sse2.c SSE optimized hash slide Copyright (C) 2017 Intel Corporation Authors: Arjan van de Ven Jim Kukunas For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/x86_features.c x86_features.c - x86 feature check Copyright (C) 2013 Intel Corporation. All rights reserved. Author: Jim Kukunas For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/x86_features.h x86_features.h -- check for CPU features Copyright (C) 2013 Intel Corporation Jim Kukunas For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch/x86/x86_functions.h x86_functions.h -- x86 implementations for arch-specific functions. Copyright (C) 2013 Intel Corporation Jim Kukunas For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/arch_functions.h arch_functions.h -- Arch-specific function prototypes. Copyright (C) 2017 Hans Kristian Rosbach For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/chunkset_tpl.h chunkset_tpl.h -- inline functions to copy small data chunks. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/cmake/detect-arch.c archdetect.c -- Detect compiler architecture and raise preprocessor error containing a simple arch identifier. Copyright (C) 2019 Hans Kristian Rosbach Licensed under the Zlib license, see LICENSE.md for details ## Files: rust/vendor/libz-sys/src/zlib-ng/compare256_rle.h compare256_rle.h -- 256 byte run-length encoding comparison Copyright (C) 2022 Nathan Moinvaziri For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/cpu_features.c cpu_features.c -- CPU architecture feature check Copyright (C) 2017 Hans Kristian Rosbach For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/cpu_features.h cpu_features.h -- CPU architecture feature check Copyright (C) 2017 Hans Kristian Rosbach For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/crc32.h crc32.h -- crc32 folding interface Copyright (C) 2021 Nathan Moinvaziri For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/crc32_braid_comb.c crc32_braid_comb.c -- compute the CRC-32 of a data stream Copyright (C) 1995-2022 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h This interleaved implementation of a CRC makes use of pipelined multiple arithmetic-logic units, commonly found in modern CPU cores. It is due to Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution. ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate.h deflate.h -- internal compression state Copyright (C) 1995-2016 Jean-loup Gailly For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_fast.c deflate_fast.c -- compress data using the fast strategy of deflation algorithm Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_huff.c deflate_huff.c -- compress data using huffman encoding only strategy Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_medium.c deflate_medium.c -- The deflate_medium deflate strategy Copyright (C) 2013 Intel Corporation. All rights reserved. Authors: Arjan van de Ven For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_p.h deflate_p.h -- Private inline functions and macros shared with more than one deflate method Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_quick.c The deflate_quick deflate strategy, designed to be used when cycles are at a premium. Copyright (C) 2013 Intel Corporation. All rights reserved. Authors: Wajdi Feghali Jim Guilford Vinodh Gopal Erdinc Ozturk Jim Kukunas Portions are Copyright (C) 2016 12Sided Technology, LLC. Author: Phil Vachon For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_rle.c deflate_rle.c -- compress data using RLE strategy of deflation algorithm Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_slow.c deflate_slow.c -- compress data using the slow strategy of deflation algorithm Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/deflate_stored.c deflate_stored.c -- store data without compression using deflation algorithm Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/functable.c functable.c -- Choose relevant optimized functions at runtime Copyright (C) 2017 Hans Kristian Rosbach For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/functable.h functable.h -- Struct containing function pointers to optimized functions Copyright (C) 2017 Hans Kristian Rosbach For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/inftrees.h inftrees.h -- header to use inftrees.c Copyright (C) 1995-2022 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/insert_string.c insert_string.c -- insert_string integer hash variant Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/insert_string_roll.c insert_string_roll.c -- insert_string rolling hash variant Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/insert_string_tpl.h insert_string_tpl.h -- Private insert_string functions shared with more than one insert string implementation Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler Copyright (C) 2013 Intel Corporation. All rights reserved. Authors: Wajdi Feghali Jim Guilford Vinodh Gopal Erdinc Ozturk Jim Kukunas Portions are Copyright (C) 2016 12Sided Technology, LLC. Author: Phil Vachon For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/match_tpl.h match_tpl.h -- find longest match template for compare256 variants Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler For conditions of distribution and use, see copyright notice in zlib.h Portions copyright (C) 2014-2021 Konstantin Nosov Fast-zlib optimized longest_match https://github.com/gildor2/fast_zlib ## Files: rust/vendor/libz-sys/src/zlib-ng/uncompr.c uncompr.c -- decompress a memory buffer Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler. For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/zendian.h zendian.h -- define BYTE_ORDER for endian tests For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/zmemory.h zmemory.h -- Private inline functions used internally in zlib-ng For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/libz-sys/src/zlib-ng/zutil_p.h zutil_p.h -- Private inline functions used internally in zlib-ng For conditions of distribution and use, see copyright notice in zlib.h ## Files: rust/vendor/nix/test/test_kmod/hello_mod/hello.c SPDX-License-Identifier: GPL-2.0+ or MIT ## Files: rust/vendor/suricata-lua-sys/lua/lapi.c * $Id: lapi.c $ * Lua API * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lapi.h * $Id: lapi.h $ * Auxiliary functions from Lua API * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lauxlib.c * $Id: lauxlib.c $ * Auxiliary functions for building Lua libraries * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lauxlib.h * $Id: lauxlib.h $ * Auxiliary functions for building Lua libraries * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lbaselib.c * $Id: lbaselib.c $ * Basic library * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lcode.c * $Id: lcode.c $ * Code generator for Lua * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lcode.h * $Id: lcode.h $ * Code generator for Lua * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lcorolib.c * $Id: lcorolib.c $ * Coroutine Library * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lctype.c * $Id: lctype.c $ * 'ctype' functions for Lua * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lctype.h * $Id: lctype.h $ * 'ctype' functions for Lua * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ldblib.c * $Id: ldblib.c $ * Interface from Lua to its debug API * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ldebug.c * $Id: ldebug.c $ * Debug Interface * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ldebug.h * $Id: ldebug.h $ * Auxiliary functions from Debug Interface module * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ldo.c * $Id: ldo.c $ * Stack and Call structure of Lua * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ldo.h * $Id: ldo.h $ * Stack and Call structure of Lua * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ldump.c * $Id: ldump.c $ * save precompiled Lua chunks * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lfunc.c * $Id: lfunc.c $ * Auxiliary functions to manipulate prototypes and closures * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lfunc.h * $Id: lfunc.h $ * Auxiliary functions to manipulate prototypes and closures * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lgc.c * $Id: lgc.c $ * Garbage Collector * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lgc.h * $Id: lgc.h $ * Garbage Collector * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/linit.c * $Id: linit.c $ * Initialization of libraries for lua.c and other clients * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/liolib.c * $Id: liolib.c $ * Standard I/O (and system) library * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ljumptab.h * $Id: ljumptab.h $ * Jump Table for the Lua interpreter * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/llex.c * $Id: llex.c $ * Lexical Analyzer * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/llex.h * $Id: llex.h $ * Lexical Analyzer * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/llimits.h * $Id: llimits.h $ * Limits, basic types, and some other 'installation-dependent' definitions * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lmathlib.c * $Id: lmathlib.c $ * Standard mathematical library * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lmem.c * $Id: lmem.c $ * Interface to Memory Manager * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lmem.h * $Id: lmem.h $ * Interface to Memory Manager * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/loadlib.c * $Id: loadlib.c $ * Dynamic library loader for Lua * See Copyright Notice in lua.h * * This module contains an implementation of loadlib for Unix systems * that have dlfcn, an implementation for Windows, and a stub for other * systems. ## Files: rust/vendor/suricata-lua-sys/lua/lobject.c * $Id: lobject.c $ * Some generic functions over Lua objects * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lobject.h * $Id: lobject.h $ * Type definitions for Lua objects * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lopcodes.c * $Id: lopcodes.c $ * Opcodes for Lua virtual machine * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lopcodes.h * $Id: lopcodes.h $ * Opcodes for Lua virtual machine * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lopnames.h * $Id: lopnames.h $ * Opcode names * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/loslib.c * $Id: loslib.c $ * Standard Operating System library * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lparser.c * $Id: lparser.c $ * Lua Parser * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lparser.h * $Id: lparser.h $ * Lua Parser * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lprefix.h * $Id: lprefix.h $ * Definitions for Lua code that must come before any other header file * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lstate.c * $Id: lstate.c $ * Global State * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lstate.h * $Id: lstate.h $ * Global State * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lstring.c * $Id: lstring.c $ * String table (keeps all strings handled by Lua) * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lstring.h * $Id: lstring.h $ * String table (keep all strings handled by Lua) * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lstrlib.c * $Id: lstrlib.c $ * Standard library for string operations and pattern-matching * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ltable.c * $Id: ltable.c $ * Lua tables (hash) * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ltable.h * $Id: ltable.h $ * Lua tables (hash) * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ltablib.c * $Id: ltablib.c $ * Library for Table Manipulation * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ltm.c * $Id: ltm.c $ * Tag methods * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/ltm.h * $Id: ltm.h $ * Tag methods * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lua.c * $Id: lua.c $ * Lua stand-alone interpreter * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lua.h * $Id: lua.h $ * Lua - A Scripting Language * Lua.org, PUC-Rio, Brazil (http://www.lua.org) * See Copyright Notice at the end of this file ## Files: rust/vendor/suricata-lua-sys/lua/luac.c * $Id: luac.c $ * Lua compiler (saves bytecodes to files; also lists bytecodes) * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/luaconf.h * $Id: luaconf.h $ * Configuration file for Lua * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lualib.h * $Id: lualib.h $ * Lua standard libraries * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lundump.c * $Id: lundump.c $ * load precompiled Lua chunks * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lundump.h * $Id: lundump.h $ * load precompiled Lua chunks * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lutf8lib.c * $Id: lutf8lib.c $ * Standard library for UTF-8 manipulation * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lvm.c * $Id: lvm.c $ * Lua virtual machine * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lvm.h * $Id: lvm.h $ * Lua virtual machine * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lzio.c * $Id: lzio.c $ * Buffered streams * See Copyright Notice in lua.h ## Files: rust/vendor/suricata-lua-sys/lua/lzio.h * $Id: lzio.h $ * Buffered streams * See Copyright Notice in lua.h ## Files: rust/vendor/unicode-segmentation/scripts/unicode.py Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT file at the top-level directory of this distribution and at http://rust-lang.org/COPYRIGHT. Licensed under the Apache License, Version 2.0 or the MIT license , at your option. This file may not be copied, modified, or distributed except according to those terms. ## Files: rust/vendor/unicode-segmentation/scripts/unicode.py // Copyright 2012-2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // NOTE: The following code was generated by "scripts/unicode.py", do not edit directly #![allow(missing_docs, non_upper_case_globals, non_snake_case)] ## Files: rust/vendor/unicode-segmentation/scripts/unicode_gen_breaktests.py -*- coding: utf-8 Copyright 2015 The Rust Project Developers. See the COPYRIGHT file at the top-level directory of this distribution and at http://rust-lang.org/COPYRIGHT. Licensed under the Apache License, Version 2.0 or the MIT license , at your option. This file may not be copied, modified, or distributed except according to those terms. ## Files: rust/vendor/unicode-width/scripts/unicode.py Copyright 2011-2022 The Rust Project Developers. See the COPYRIGHT file at the top-level directory of this distribution and at http://rust-lang.org/COPYRIGHT. Licensed under the Apache License, Version 2.0 or the MIT license , at your option. This file may not be copied, modified, or distributed except according to those terms. ## Files: rust/vendor/unicode-width/scripts/unicode.py // Copyright 2012-2022 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // NOTE: The following code was generated by "scripts/unicode.py", do not edit directly use core::cmp::Ordering; #[derive(Clone, Copy, Debug, PartialEq, Eq)] struct WidthInfo(u16); impl WidthInfo { /// No special handling necessary const DEFAULT: Self = Self(0); ## Files: rust/vendor/zerocopy/cargo.sh rust/vendor/zerocopy/ci/check_all_toolchains_tested.sh rust/vendor/zerocopy/ci/check_fmt.sh rust/vendor/zerocopy/ci/check_job_dependencies.sh rust/vendor/zerocopy/ci/check_readme.sh rust/vendor/zerocopy/ci/check_versions.sh rust/vendor/zerocopy/ci/release_crate_version.sh Copyright 2024 The Fuchsia Authors Licensed under a BSD-style license , Apache License, Version 2.0 , or the MIT license , at your option. This file may not be copied, modified, or distributed except according to those terms. ## Files: rust/vendor/zerocopy/ci/check_todo.sh Copyright 2025 The Fuchsia Authors Licensed under a BSD-style license , Apache License, Version 2.0 , or the MIT license , at your option. This file may not be copied, modified, or distributed except according to those terms. ## Files: src/alert-debuglog.c src/alert-debuglog.h src/alert-fastlog.h src/alert-syslog.h src/app-layer-detect-proto.h src/app-layer-ssh.c src/app-layer-ssh.h src/app-layer.h src/detect-flowint.h src/detect-flowvar.h src/detect-hostbits.h src/detect-xbits.h src/log-pcap.h src/log-tlslog.c src/source-ipfw.c src/suricata.h src/tmqh-packetpool.h src/util-mpm-ac.c src/util-mpm-ac.h src/util-mpm.h src/util-prefilter.c src/util-spm-bm.c Copyright (C) 2007-2014 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/alert-fastlog.c src/alert-syslog.c src/app-layer-htp-file.c src/app-layer-protos.h src/app-layer-smtp.h src/decode-ethernet.c src/decode-ethernet.h src/decode-gre.c src/decode-pppoe.c src/decode-raw.c src/decode-sll.c src/detect-engine-address.h src/detect-engine-event.c src/detect-engine-file.c src/detect-engine-mpm.c src/detect-engine-payload.c src/detect-engine-siggroup.c src/detect-engine-state.c src/detect-engine-tag.c src/detect-engine-threshold.h src/detect-engine.h src/detect-fast-pattern.c src/detect-fast-pattern.h src/detect-filestore.c src/detect-fragoffset.c src/detect-gid.c src/detect-http-client-body.c src/detect-http-header-common.c src/detect-http-start.c src/detect-icode.c src/detect-id.c src/detect-ipopts.c src/detect-sameip.c src/detect-sid.c src/detect-threshold.c src/host-storage.c src/host-storage.h src/ippair-storage.c src/ippair-storage.h src/log-pcap.c src/output-json-email-common.h src/output-json-file.c src/output-json-file.h src/output-json-http.c src/output-json-smtp.c src/output-json.h src/tests/detect-http-client-body.c src/tests/detect-http-user-agent.c src/tests/stream-tcp-reassemble.c src/tests/stream-tcp.c src/util-debug.c src/util-error.c src/util-file.h src/util-logopenfile.h src/util-mpm.c src/util-unittest.h Copyright (C) 2007-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-detect-proto.c src/app-layer-protos.c src/app-layer-ssl.h src/decode-events.c src/decode-events.h src/decode-icmpv4.h src/decode-icmpv6.h src/decode-ipv6.h src/decode-tcp.h src/decode-udp.h src/decode-vlan.c src/decode-vlan.h src/defrag-config.c src/defrag-config.h src/detect-app-layer-event.h src/detect-app-layer-protocol.h src/detect-bytetest.c src/detect-content.c src/detect-content.h src/detect-csum.h src/detect-dce-iface.c src/detect-dce-opnum.c src/detect-dsize.c src/detect-dsize.h src/detect-engine-address.c src/detect-engine-alert.c src/detect-engine-alert.h src/detect-engine-iponly.c src/detect-engine-iponly.h src/detect-engine-proto.c src/detect-engine.c src/detect-file-data.c src/detect-filemagic.h src/detect-filename.c src/detect-filename.h src/detect-hostbits.c src/detect-http-header.c src/detect-http-raw-header.c src/detect-http-request-line.c src/detect-http-response-line.c src/detect-icmp-seq.c src/detect-ipproto.c src/detect-lua-extensions.c src/detect-lua.h src/detect-tls-cert-issuer.c src/detect-tls-cert-subject.c src/detect-uricontent.c src/output-json-dns.c src/output-streaming.c src/output-tx.c src/output-tx.h src/packet.c src/packet.h src/reputation.c src/reputation.h src/runmode-pcap.c src/runmodes.h src/stream-tcp-cache.c src/stream-tcp-cache.h src/suricata-common.h src/tests/detect-file-data.c src/tests/detect-parse.c src/tmqh-packetpool.c src/util-action.c src/util-byte.h src/util-cidr.c src/util-debug.h src/util-host-os-info.c src/util-host-os-info.h src/util-logopenfile.c src/util-memcmp.h src/util-misc.c src/util-misc.h src/util-profiling-prefilter.c src/util-proto-name.c src/util-proto-name.h src/util-radix-tree-common.h src/util-radix4-tree.c src/util-radix4-tree.h src/util-radix6-tree.c src/util-radix6-tree.h src/util-reference-config.c src/util-spm.c src/util-spm.h Copyright (C) 2007-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-dnp3-objects.c src/app-layer-dnp3-objects.h src/app-layer-dnp3.h src/detect-base64-data.c src/detect-base64-data.h src/detect-dnp3.h src/detect-engine-loader.h src/detect-tls-cert-validity.h src/log-tlsstore.h src/output-json-dhcp.h src/output-json-dnp3-objects.c src/output-json-dnp3.h src/output-json-ike.h src/util-lua-dnp3-objects.c src/util-lua-dnp3-objects.h src/util-lua-dnp3.c src/util-lua-dnp3.h src/util-lua-ssh.h Copyright (C) 2015 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-dnp3.c src/util-lua-tls.h Copyright (C) 2015-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-events.c src/log-stats.c src/output-json-stats.c src/output-json-stats.h Copyright (C) 2014-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-events.h src/output-lua.c src/output-stats.c src/runmode-netmap.c src/runmode-nflog.c src/runmode-nflog.h src/util-lua.c src/util-lua.h Copyright (C) 2014-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-frames.c src/app-layer-htp.c src/app-layer-ssl.c src/app-layer.c src/counters.c src/decode-ipv4.c src/decode-ipv4.h src/decode-ipv6.c src/decode-ppp.c src/decode-tcp.c src/decode.c src/decode.h src/defrag-hash.c src/defrag-hash.h src/defrag-stack.h src/defrag.c src/detect-byte-extract.c src/detect-byte-extract.h src/detect-csum.c src/detect-engine-proto.h src/detect-engine-register.c src/detect-engine-register.h src/detect-engine-sigorder.c src/detect-engine-threshold.c src/detect-lua.c src/detect-noalert.c src/detect-reference.h src/detect-threshold.h src/flow-hash.c src/flow-manager.c src/flow-timeout.c src/flow-timeout.h src/flow.c src/output-file.c src/output-file.h src/output-filedata.c src/output-filedata.h src/output-flow.c src/output-flow.h src/output-json-tls.c src/output-json-tls.h src/output-packet.c src/output-packet.h src/output-streaming.h src/output.c src/output.h src/runmodes.c src/stream-tcp-reassemble.c src/stream-tcp-reassemble.h src/tests/detect-http-host.c src/tm-modules.c src/tm-modules.h src/tm-threads.c src/tm-threads.h src/util-log-redis.c src/util-mpm-hs-cache.c src/util-mpm-hs-core.c src/util-mpm-hs-core.h src/util-profiling.c src/util-rohash.c src/util-thash.c src/util-thash.h src/util-var.c src/util-var.h Copyright (C) 2007-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-frames.h src/decode-vntag.c src/decode-vntag.h src/detect-engine-frame.h src/detect-frame.h src/detect-quic-cyu-hash.h src/detect-quic-cyu-string.h src/detect-quic-version.c src/detect-quic-version.h src/output-eve-syslog.c src/output-eve-syslog.h src/runmode-dpdk.h src/source-dpdk.h src/util-datalink.c src/util-datalink.h src/util-dpdk.c src/util-dpdk.h Copyright (C) 2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-ftp.c src/app-layer-ftp.h src/app-layer-parser.c src/app-layer-parser.h src/app-layer-smtp.c src/detect-app-layer-protocol.c src/detect-app-layer-state.c src/detect-app-layer-state.h src/detect-engine-analyzer.c src/detect-engine-build.c src/detect-flowbits.c src/detect-flowbits.h src/detect-parse.c src/detect-pcre.c src/detect-tcp-wscale.c src/detect.c src/detect.h src/flow.h src/output-json-flow.c src/stream-tcp.c src/stream-tcp.h src/suricata.c src/tx-bit.h src/util-profiling-rulegroups.c Copyright (C) 2007-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-htp-body.c src/app-layer-htp-body.h src/app-layer-htp-file.h src/detect-engine-file.h src/detect-file-data.h src/detect-filestore.h src/output-json-drop.h src/runmode-ipfw.c src/runmode-nfq.c src/source-ipfw.h src/stream-tcp-sack.c src/stream-tcp-sack.h src/stream-tcp-util.c src/stream-tcp-util.h src/util-magic.h Copyright (C) 2007-2011 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-htp-mem.c src/app-layer-htp-mem.h src/flow-storage.c src/runmode-unittests.h src/util-conf.c src/util-conf.h src/util-pool-thread.c src/util-pool-thread.h src/util-running-modes.c src/util-running-modes.h Copyright (C) 2013 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-htp-xff.c src/app-layer-htp-xff.h src/decode-mpls.h src/log-stats.h src/log-tcp-data.c src/log-tlsstore.c src/output-json-netflow.h src/output-lua.h src/source-nflog.c src/source-nflog.h src/util-host-info.c src/util-host-info.h src/util-lua-common.h src/util-lua-dns.h src/util-lua-http.h src/util-lua-ssh.c src/util-lua-tls.c src/util-memcpy.h Copyright (C) 2014 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-htp.h src/decode-icmpv4.c src/decode-udp.c src/detect-bytejump.c src/detect-bytejump.h src/detect-bytetest.h src/detect-classtype.c src/detect-config.c src/detect-config.h src/detect-detection-filter.c src/detect-filesize.c src/detect-flow.c src/detect-flowint.c src/detect-flowvar.c src/detect-fragbits.c src/detect-icmp-id.c src/detect-isdataat.c src/detect-itype.c src/detect-parse.h src/detect-pcre.h src/detect-pktvar.c src/detect-priority.c src/detect-reference.c src/detect-rpc.c src/detect-ssh-hassh-server-string.c src/detect-ssh-hassh-server-string.h src/detect-ssh-hassh-server.c src/detect-ssh-hassh-server.h src/detect-ssh-hassh-string.c src/detect-ssh-hassh-string.h src/detect-ssh-hassh.c src/detect-ssh-hassh.h src/detect-ssh-proto-version.c src/detect-ssh-software-version.c src/detect-ssl-state.c src/detect-ssl-version.c src/detect-stream_size.c src/detect-tag.c src/detect-target.c src/detect-tcp-flags.c src/detect-tcp-window.c src/detect-tcpmss.c src/detect-template2.c src/detect-tls-version.c src/detect-tos.c src/detect-ttl.c src/detect-urilen.c src/detect-xbits.c src/flow-manager.h src/flow-queue.c src/flow-spare-pool.h src/respond-reject-libnet11.h src/respond-reject.c src/respond-reject.h src/source-pcap-file-helper.c src/source-pcap-file-helper.h src/threads.h src/tmqh-flow.c src/util-atomic.h src/util-file.c src/util-mem.c src/util-mem.h src/util-time.c Copyright (C) 2007-2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-http2.c src/app-layer-http2.h src/app-layer-ike.c src/app-layer-ike.h src/decode-chdlc.h src/decode-esp.h src/decode-geneve.h src/decode-nsh.h src/detect-byte.c src/detect-byte.h src/detect-bytemath.h src/detect-engine-uint.c src/detect-engine-uint.h src/detect-http2.h src/detect-icmpv4hdr.c src/detect-icmpv4hdr.h src/detect-icmpv6-mtu.c src/detect-icmpv6-mtu.h src/detect-icmpv6hdr.c src/detect-icmpv6hdr.h src/detect-ike-chosen-sa.c src/detect-ike-chosen-sa.h src/detect-ike-exch-type.c src/detect-ike-exch-type.h src/detect-ike-key-exchange-payload-length.c src/detect-ike-key-exchange-payload-length.h src/detect-ike-key-exchange-payload.c src/detect-ike-key-exchange-payload.h src/detect-ike-nonce-payload-length.c src/detect-ike-nonce-payload-length.h src/detect-ike-nonce-payload.c src/detect-ike-nonce-payload.h src/detect-ike-spi.c src/detect-ike-spi.h src/detect-ike-vendor.h src/detect-transform-pcrexform.c src/detect-transform-pcrexform.h src/main.c src/output-json-mqtt.h src/rust-context.c src/tests/detect-http2.c src/tests/detect-icmpv4hdr.c src/tests/detect-icmpv6-mtu.c src/tests/detect-icmpv6hdr.c src/tests/detect-transform-pcrexform.c src/tests/source-pcap.c src/util-config.h src/util-macset.c src/util-macset.h src/util-plugin.h suricata-update/suricata/update/osinfo.py Copyright (C) 2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-nfs-tcp.c src/app-layer-nfs-udp.c src/decode-null.c src/decode-template.c src/output-json-dhcp.c src/output-json-dnp3.c src/output-json-nfs.c Copyright (C) 2015-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-register.c src/detect-ftpdata.c src/detect-nfs-procedure.c src/detect-nfs-version.c src/output-json-nfs.h Copyright (C) 2017-2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/app-layer-tftp.c src/datasets-md5.c src/datasets-sha256.c src/datasets-string.c src/datasets.c Copyright (C) 2017-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/bindgen.h src/datasets-context-json.c src/decode-sll2.c src/decode-sll2.h src/detect-dns-name.c src/detect-dns-response.c src/detect-email.c src/detect-email.h src/detect-engine-buffer.c src/detect-engine-buffer.h src/detect-engine-inspect-buffer.c src/detect-engine-inspect-buffer.h src/detect-entropy.c src/detect-ftp-command-data.c src/detect-ftp-command-data.h src/detect-ftp-command.c src/detect-ftp-command.h src/detect-ftp-completion-code.c src/detect-ftp-completion-code.h src/detect-ftp-dynamic-port.c src/detect-ftp-dynamic-port.h src/detect-ftp-mode.c src/detect-ftp-mode.h src/detect-ftp-reply-received.c src/detect-ftp-reply-received.h src/detect-ftp-reply.c src/detect-ftp-reply.h src/detect-smtp.c src/detect-smtp.h src/output-eve-bindgen.h src/output-json-mdns.c src/output-json-mdns.h src/util-dpdk-common.c src/util-dpdk-common.h src/util-dpdk-mlx5.c src/util-dpdk-mlx5.h src/util-dpdk-rss.c src/util-dpdk-rss.h src/util-flow-rate.c src/util-flow-rate.h src/util-lua-base64lib.c src/util-lua-base64lib.h src/util-lua-builtins.c src/util-lua-builtins.h src/util-lua-bytevarlib.c src/util-lua-bytevarlib.h src/util-lua-config.c src/util-lua-config.h src/util-lua-dataset.c src/util-lua-dataset.h src/util-lua-filelib.c src/util-lua-filelib.h src/util-lua-flowintlib.c src/util-lua-flowintlib.h src/util-lua-flowlib.c src/util-lua-flowlib.h src/util-lua-flowvarlib.c src/util-lua-flowvarlib.h src/util-lua-hashlib.c src/util-lua-hashlib.h src/util-lua-log.c src/util-lua-log.h src/util-lua-packetlib.c src/util-lua-packetlib.h src/util-lua-rule.c src/util-lua-rule.h src/util-lua-util.c src/util-lua-util.h src/util-mpm-ac-queue.c src/util-mpm-ac-queue.h Copyright (C) 2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/conf-yaml-loader.c src/conf.c src/conf.h src/detect-app-layer-event.c src/detect-distance.c src/detect-engine-analyzer.h src/detect-engine-content-inspection.c src/detect-engine-content-inspection.h src/detect-filemagic.c src/detect-http-server-body.c src/detect-tls-sni.c src/detect-within.c src/flow-spare-pool.c src/output-json-drop.c src/output-json.c src/respond-reject-libnet11.c src/source-nfq.c src/stream-tcp-list.c src/util-buffer.c src/util-buffer.h src/util-error.h src/util-path.c src/util-print.c src/util-threshold-config.c src/util-var-name.c Copyright (C) 2007-2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/counters.h src/output-json-email-common.c Copyright (C) 2007-2015 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/datasets-ipv4.c src/datasets-ipv4.h src/datasets-ipv6.c src/datasets-ipv6.h src/detect-flow-age.c src/detect-flow-age.h src/detect-ipaddr.c src/detect-ipaddr.h src/detect-krb5-ticket-encryption.c src/detect-krb5-ticket-encryption.h src/detect-quic-sni.c src/detect-quic-sni.h src/detect-quic-ua.c src/detect-quic-ua.h src/detect-smb-ntlmssp.c src/detect-smb-ntlmssp.h src/detect-tls-random.c src/detect-tls-random.h src/runmode-af-xdp.c src/runmode-af-xdp.h src/source-af-xdp.h src/tests/detect-engine-alert.c src/tests/detect-ipaddr.c src/util-landlock.c src/util-landlock.h Copyright (C) 2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/datasets-md5.h src/datasets-reputation.h src/datasets-sha256.h src/datasets-string.h Copyright (C) 2017-2019 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/decode-chdlc.c src/decode-erspan.c src/decode-esp.c src/decode-geneve.c src/decode-nsh.c src/output-json-mqtt.c src/suricata-plugin.h src/util-plugin.c Copyright (C) 2020-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/decode-mpls.c src/host-bit.c src/ippair-bit.c src/runmode-netmap.h src/source-netmap.h src/tx-bit.c src/util-lua-common.c Copyright (C) 2014-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/decode-sctp.c src/detect-mark.c src/source-af-packet.c src/util-device.c Copyright (C) 2011-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/decode-sctp.h src/detect-mark.h src/runmode-af-packet.h src/util-runmodes.h Copyright (C) 2011 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/decode-template.h src/tests/detect-template.c Copyright (C) 2015-2018 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/decode-teredo.c src/detect-iprep.c Copyright (C) 2012-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/decode-vxlan.c src/output-json-anomaly.c Copyright (C) 2019-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/defrag-stack.c src/defrag-timeout.c src/defrag-timeout.h src/detect-filemd5.c src/detect-filemd5.h src/detect-filesize.h src/detect-http-ua.h src/flow-hash.h src/flow-queue.h src/flow-util.h src/host-queue.c src/host-queue.h src/host-timeout.c src/host-timeout.h src/host.c src/ippair-queue.c src/ippair-queue.h src/ippair-timeout.c src/ippair-timeout.h src/ippair.c src/log-tlslog.h src/util-atomic.c src/util-path.h src/util-profiling-locks.c src/util-profiling-locks.h src/util-profiling-rules.c src/util-profiling.h src/util-rohash.h src/util-signal.c src/util-signal.h Copyright (C) 2007-2012 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/defrag.h src/detect-engine-state.h src/detect-http-host.h src/detect-lua-extensions.h src/detect-tag.h src/flow-bit.c src/flow-storage.h src/flow-util.c src/flow-var.h src/host.h src/ippair.h src/log-httplog.c src/output-json-dns.h src/output-stats.h src/threads-debug.h src/threads-profile.h src/threadvars.h src/tm-threads-common.h src/tmqh-simple.c src/util-cpu.c src/util-debug-filters.c src/util-ip.c src/util-ip.h src/util-magic.c src/util-memrchr.c src/util-profiling-keywords.c src/util-storage.c src/util-storage.h src/util-syslog.c src/util-time.h Copyright (C) 2007-2013 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-asn1.c src/detect-asn1.h src/detect-bytemath.c src/detect-http2.c src/detect-ike-vendor.c Copyright (C) 2020-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-base64-decode.h src/detect-dnp3.c Copyright (C) 2015-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-bsize.c src/detect-tls-cert-fingerprint.c src/detect-tls-cert-serial.c src/tests/detect-bsize.c Copyright (C) 2017-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-bsize.h Copyright (C) 2017-2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-bypass.c Copyright (C) 2016-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-bypass.h src/detect-engine-profile.h src/detect-tls-cert-issuer.h src/detect-tls-cert-subject.h src/detect-tls-sni.h src/flow-worker.h src/log-cf-common.h src/output-json-dnp3-objects.h src/util-hyperscan.c src/util-pages.c src/util-pages.h src/util-prefilter.h src/util-spm-hs.h Copyright (C) 2016 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-datarep.c src/detect-krb5-errcode.c src/detect-krb5-msgtype.c src/output-json-common.c Copyright (C) 2018-2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-dataset.c Copyright (C) 2018-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-dns-name.h src/detect-engine-helper.c src/detect-engine-helper.h src/detect-ja4-hash.c src/detect-ja4-hash.h src/detect-requires.c src/detect-requires.h src/output-eve-null.c src/output-eve-null.h src/output-eve-stream.h src/util-dpdk-bonding.c src/util-dpdk-bonding.h src/util-hugepages.c src/util-hugepages.h Copyright (C) 2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-engine-build.h src/detect-http-accept-enc.c src/detect-http-accept-enc.h src/detect-http-accept-lang.c src/detect-http-accept-lang.h src/detect-http-accept.c src/detect-http-accept.h src/detect-http-connection.c src/detect-http-connection.h src/detect-http-content-len.c src/detect-http-content-len.h src/detect-http-content-type.c src/detect-http-content-type.h src/detect-http-header-common.h src/detect-http-header-names.c src/detect-http-headers.c src/detect-http-headers.h src/detect-http-protocol.c src/detect-http-referer.c src/detect-http-referer.h src/detect-metadata.c src/stream.c src/stream.h src/tests/detect-engine-content-inspection.c src/tests/detect.c src/tests/stream-tcp-inline.c src/util-hash-string.c src/util-hash-string.h src/util-ja3.c src/util-ja3.h src/util-random.c src/util-random.h src/util-unittest-helper.c Copyright (C) 2007-2017 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-engine-frame.c src/detect-engine-loader.c Copyright (C) 2021-2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-engine-prefilter-common.c src/detect-engine-prefilter-common.h src/detect-file-hash-common.c src/detect-file-hash-common.h src/detect-filesha1.c src/detect-filesha1.h src/detect-filesha256.c src/detect-filesha256.h src/detect-http-header-names.h src/detect-http-protocol.h src/detect-http-request-line.h src/detect-http-response-line.h src/detect-http-start.h src/detect-prefilter.c src/detect-prefilter.h src/detect-ssh-proto.c src/detect-ssh-proto.h src/detect-ssh-software.c src/detect-ssh-software.h src/detect-tcp-ack.c src/flow-private.h src/log-cf-common.c src/pkt-var.c src/pkt-var.h src/source-pcap-file-directory-helper.c src/source-pcap-file.c src/stream-tcp-inline.c src/stream-tcp-inline.h src/stream-tcp-list.h src/tests/detect-http-cookie.c src/tests/detect-http-raw-header.c src/tests/detect-http-stat-code.c src/tests/detect-http-stat-msg.c src/tests/stream-tcp-list.c src/util-hyperscan.h src/util-mpm-hs.c src/util-mpm-hs.h src/util-var-name.h Copyright (C) 2007-2016 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-engine-prefilter.c src/detect-engine-prefilter.h Copyright (C) 2016-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-engine-profile.c Copyright (C) 2016-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-flow-pkts.c src/detect-flow-pkts.h Copyright (C) 2023-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-frame.c src/detect-quic-cyu-hash.c src/detect-quic-cyu-string.c Copyright (C) 2021-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-geoip.c src/detect-geoip.h Copyright (C) 2012-2019 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-iprep.h src/detect-l3proto.h src/detect-pkt-data.h src/runmode-unix-socket.c src/runmode-unix-socket.h src/unix-manager.h Copyright (C) 2012 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-krb5-cname.c src/detect-krb5-sname.c src/output-filestore.c suricata-update/suricata/update/data/update.py Copyright (C) 2018-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-krb5-cname.h src/detect-krb5-errcode.h src/detect-krb5-msgtype.h src/detect-krb5-sname.h src/detect-template.h Copyright (C) 2015-2017 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-l3proto.c Copyright (C) 2012-2013 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-replace.c src/source-af-xdp.c src/source-netmap.c src/util-sysfs.c src/util-sysfs.h Copyright (C) 2011-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-replace.h Copyright (C) 2011-2014 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-smb-version.c src/detect-smb-version.h Copyright (C) 2022-2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-template.c src/detect-tls-cert-validity.c Copyright (C) 2015-2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/detect-tls-certs.c Copyright (C) 2019-2022 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/device-storage.c src/device-storage.h src/output-json-ike.c src/util-ebpf.c Copyright (C) 2018-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/flow-bypass.c src/flow-bypass.h Copyright (C) 2016-2018 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/flow-worker.c src/util-log-redis.h Copyright (C) 2016-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/output-json-alert.c src/runmode-unittests.c Copyright (C) 2013-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/output-json-alert.h Copyright (C) 2013-2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/output-json-frame.c src/output-json-frame.h src/output-json-metadata.c Copyright (C) 2013-2021 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/output-json-metadata.h Copyright (C) 2013-2015 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/output-json-netflow.c Copyright (C) 2014-2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/output-json-pgsql.c src/output-json-pgsql.h Copyright (C) 2022-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/runmode-af-packet.c Copyright (C) 2011-2024 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/runmode-dpdk.c src/source-dpdk.c src/util-dpdk-i40e.c src/util-dpdk-i40e.h src/util-dpdk-ice.c src/util-dpdk-ice.h src/util-dpdk-ixgbe.c src/util-dpdk-ixgbe.h Copyright (C) 2021-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/source-af-packet.h Copyright (C) 2011,2012 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/source-erf-dag.c Copyright (C) 2010-2020 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/source-erf-dag.h src/source-erf-file.h src/util-affinity.h src/util-ioctl.c src/util-ioctl.h Copyright (C) 2010 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/source-erf-file.c Copyright (C) 2010-2014 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/tests/detect-tls-cert-validity.c Copyright (C) 2015-2019 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/unix-manager.c Copyright (C) 2013-2018 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-affinity.c Copyright (C) 2010-2016 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-checksum.c src/util-checksum.h Copyright (C) 2011-2012 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-coredump-config.h Copyright (C) 2007-2010 Open Information Security Foundation * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. ## Files: src/util-device-private.h src/util-device.h Copyright (C) 2011-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-exception-policy.c src/util-exception-policy.h Copyright (C) 2022-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-lua-dns.c src/util-lua-http.c src/util-lua-smtp.c src/util-lua-smtp.h Copyright (C) 2014-2025 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-mpm-ac-ks-small.c src/util-mpm-ac-ks.c src/util-mpm-ac-ks.h Copyright (C) 2013-2014 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-runmodes.c Copyright (C) 2011-2019 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-spm-hs.c Copyright (C) 2016-2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-streaming-buffer.c Copyright (C) 2015-2023 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: src/util-streaming-buffer.h Copyright (C) 2015-2016 Open Information Security Foundation You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/suricata/update/config.py suricata-update/suricata/update/parsers.py Copyright (C) 2017 Open Information Security Foundation Copyright (c) 2015-2017 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/suricata/update/engine.py suricata-update/tests/test_main.py Copyright (C) 2017 Open Information Security Foundation Copyright (c) 2015 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/suricata/update/extract.py Copyright (C) 2017 Open Information Security Foundation Copyright (c) 2017 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/suricata/update/loghandler.py Copyright (C) 2017 Open Information Security Foundation Copyright (c) 2016 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/suricata/update/main.py Copyright (C) 2017-2022 Open Information Security Foundation Copyright (c) 2015-2017 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/suricata/update/maps.py suricata-update/suricata/update/net.py suricata-update/suricata/update/util.py suricata-update/tests/test_net.py suricata-update/tests/test_util.py Copyright (C) 2017 Open Information Security Foundation Copyright (c) 2013 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/suricata/update/rule.py Copyright (C) 2017-2019 Open Information Security Foundation Copyright (c) 2011 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## Files: suricata-update/tests/test_rule.py Copyright (C) 2017 Open Information Security Foundation Copyright (c) 2011-2013 Jason Ish You can copy, redistribute or modify this Program under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.