Name: service/network/suricata Summary: Network analysis and threat detection software Publisher: solaris Version: 7.0.8 Build Release: 11.4 Branch: 11.4.81.0.0.193.0 Packaging Date: Fri Mar 21 23:26:40 2025 Size: 136.40 MB Compressed Size: 33.47 MB FMRI: pkg://solaris/service/network/suricata@7.0.8,11.4-11.4.81.0.0.193.0:20250321T232640Z License: ## Files: COPYING 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 The MIT License (MIT) 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/data-encoding/LICENSE rust/vendor/generic-array/LICENSE The MIT License (MIT) Copyright (c) 2015 Bartłomiej Kamiński Copyright (c) 2015-2020 Julien Cretin Copyright (c) 2017-2020 Google Inc. 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/lzma-rs/LICENSE rust/vendor/miniz_oxide/LICENSE rust/vendor/test-case/LICENSE MIT License Copyright (c) 2017 - 2018 Guillaume Endignoux Copyright (c) 2017 Frommi Copyright (c) 2017 Marcin Sas-Szymański 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/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/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: libhtp/LICENSE libhtp/test/files/generate-gzip-tests.php src/app-layer-htp-libhtp.c src/app-layer-htp-libhtp.h 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 rust/vendor/brotli/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/master/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) - [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/codebase/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/codebase/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: contrib/file_processor/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: libhtp/COPYING See LICENSE. ## Files: libhtp/README 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 goals of the project, in the order of importance, are as follows: 1. Completeness of coverage; LibHTP must be able to parse virtually all traffic that is found in practice. 2. Permissive parsing; LibHTP must never fail to parse a stream that would be parsed by some other web server. 3. Awareness of evasion techniques; LibHTP must be able to detect and effectively deal with various evasion techniques, producing, where practical, identical or practically identical results as the web server processing the same traffic stream. 4. Performance; The performance must be adequate for the desired tasks. Completeness and security are often detrimental to performance. Our idea of handling the conflicting requirements is to put the library user in control, allowing him to choose the most desired library characteristic. | STATUS LIBHTP IS VERY YOUNG AT THIS POINT. IT WILL BE SOME TIME BEFORE | IT CAN BE CONSIDER COMPLETE. AT THE MOMENT, THE FOCUS OF DEVELOPMENT | IS ON ACHIEVING THE FIRST TWO GOALS. See the LICENSE, COPYING and NOTICE files distributed with this work for information regarding licensing, copying and copyright ownership. INSTALLATION ------------ Assuming you're using an already packaged version of LibHTP, the installation process should be as simple as: $ sudo chmod u+x autogen.sh $ ./autogen.sh $ ./configure $ make $ sudo make install If you've retrieved your LibHTP directly from the repository, you will need to perform the following steps first: 1. Update the version number in VERSION. 2. Run autogen.sh, which will update the build system. DOCUMENTATION ------------- The best documentation at this time is the code itself and the Doxygen output (which should be all right). There's also a quick start guide in the doc/ folder, which should give you enough information to get going. 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/adler/README.md # Adler-32 checksums for Rust [![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). - Supports `#![no_std]` (with `default-features = false`). ## Usage Add an entry to your `Cargo.toml`: ```toml [dependencies] adler = "1.0.2" ``` 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.31.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. ## 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/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.53.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.53.0 Note: if the `bits` feature is enabled, MSRV is 1.56.0 (due to `bitvec` 1.0) # Recipes See [doc::recipes] and [doc::derive] for more examples and recipes. ## 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.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 http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://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) [![Build](https://travis-ci.org/marshallpierce/rust-base64.svg?branch=master)](https://travis-ci.org/marshallpierce/rust-base64) [![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_config_slice` decodes into an existing `&mut [u8]` and is pretty fast (2.6GiB/s for a 3 KiB input), whereas `decode_config` 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. Example --- ```rust extern crate base64; use base64::{encode, decode}; fn main() { let a = b"hello world"; let b = "aGVsbG8gd29ybGQ="; assert_eq!(encode(a), b); assert_eq!(a, &decode(b).unwrap()[..]); } ``` See the [docs](https://docs.rs/base64) for all the details. Rust version compatibility --- The minimum required Rust version is 1.34.0. Developing --- Benchmarks are in `benches/`. Running them requires nightly rust, but `rustup` makes it easy: ```bash rustup run nightly cargo bench ``` Decoding is aided by some pre-calculated tables, which are generated by: ```bash cargo run --example make_tables > src/tables.rs.tmp && mv src/tables.rs.tmp src/tables.rs ``` 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 `rustup nightly run 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 `rustup run nightly 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 ======== [![Build Status](https://travis-ci.com/bitflags/bitflags.svg?branch=master)](https://travis-ci.com/bitflags/bitflags) [![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) ![Minimum rustc version](https://img.shields.io/badge/rustc-1.20+-yellow.svg) ![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.0" ``` and this to your crate root: ```rust #[macro_use] extern crate bitflags; ``` ## Rust Version Support The minimum supported Rust version is 1.20 due to use of associated constants. ## 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/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/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/cpufeatures/README.md # [RustCrypto]: CPU Feature Detection [![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] 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 [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/workflows/cpufeatures/badge.svg?branch=master&event=push [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][travis-img]][travis] [![Crates.io][crates-img]][crates] [![Documentation][docs-img]][docs] [travis-img]: https://travis-ci.com/srijs/rust-crc32fast.svg?branch=master [travis]: https://travis-ci.com/srijs/rust-crc32fast [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/8.2.0/status.svg)](https://deps.rs/crate/der-parser/8.2.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.53.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(&bytes).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/der-parser-6.0.1/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/5.0.0/status.svg)](https://deps.rs/crate/der-parser/5.0.1) [![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.48.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(&bytes).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 6.0 series of `der-parser` requires **Rustc version 1.48 or greater**, based on 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/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/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 stable and the last stable for the latest version. For example, if the current stable is 1.64, this crate supports 1.64 and 1.63. Older stables may work, but we don't guarantee these will continue to work. ## 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/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. # License The `getrandom` library is distributed under either of * [Apache License, Version 2.0](LICENSE-APACHE) * [MIT license](LICENSE-MIT) at your option. ## 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/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/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. [![Travis-CI Status](https://travis-ci.com/rust-lang-nursery/lazy-static.rs.svg?branch=master)](https://travis-ci.com/rust-lang-nursery/lazy-static.rs) [![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.27.2+` 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.4.0" ``` ...and see the [docs](https://docs.rs/lazy_static) for how to use it. # Example ```rust #[macro_use] extern crate 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()); } ``` ## 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. 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 ## 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`. * `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s. If you use Rust >= 1.62, this feature is implicitly enabled. Otherwise it requires a nightly rustc. * **deprecated**: `use_std` is deprecated, and is equivalent to `std`. ## Rust version support The minimum supported Rust toolchain version is currently **Rust 1.13.0**. (libc does not currently have any policy regarding changes to the minimum supported Rust version; such policy is a work in progress.) APIs requiring newer Rust features are only available on newer Rust toolchains: | Feature | Version | |----------------------|---------| | `union` | 1.19.0 | | `const mem::size_of` | 1.24.0 | | `repr(align)` | 1.25.0 | | `extra_traits` | 1.25.0 | | `core::ffi::c_void` | 1.30.0 | | `repr(packed(N))` | 1.33.0 | | `cfg(target_vendor)` | 1.33.0 | | `const-extern-fn` | 1.62.0 | ## Platform support You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see. See [`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/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/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) [![](https://meritbadge.herokuapp.com/memchr)](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 platforms, when the `std` feature is disabled, the SSE2 accelerated implementations will be used. When `std` is enabled, AVX accelerated implementations will be used if the CPU is determined to support it at runtime. ### Using libc `memchr` is a routine that is part of libc, although this crate does not use libc by default. Instead, it uses its own routines, which are either vectorized or generic fallback routines. In general, these should be competitive with what's in libc, although this has not been tested for all architectures. If using `memchr` from libc is desirable and a vectorized routine is not otherwise available in this crate, then enabling the `libc` feature will use libc's version of `memchr`. The rest of the functions in this crate, e.g., `memchr2` or `memrchr3` and the substring search routines, will always use the implementations in this crate. One exception to this is `memrchr`, which is an extension in `libc` found on Linux. On Linux, `memrchr` is used in precisely the same scenario as `memchr`, as described above. ### 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. ### 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. ## 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/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.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-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.31 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.31 | 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.61 | pure rust | fixed width, parity with Rust primitives including floats | | [`crypto-bigint`] | MIT/Apache-2.0 | 1.57 | 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.8](https://img.shields.io/badge/rustc-1.8+-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" ``` and this to your crate root: ```rust extern crate num_integer; ``` ## 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. 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. ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-integer` crate is tested for rustc 1.8 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.8](https://img.shields.io/badge/rustc-1.8+-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" ``` and this to your crate root: ```rust extern crate num_iter; ``` ## 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. 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. ## Releases Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-iter` crate is tested for rustc 1.8 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.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-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.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_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.53.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.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.53 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/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/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/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 anything that implements `IntoIterator`, including `Vec` or a pre-existing 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/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/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(2019-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(2019-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`.
## 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 } ```
#### 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: rustc 1.31+]][Rust 1.31] [![serde_derive: rustc 1.56+]][Rust 1.56] [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: rustc 1.31+]: https://img.shields.io/badge/serde-rustc_1.31+-lightgray.svg [serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg [Rust 1.31]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html [Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.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/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/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/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.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.56 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/README.md [![Crates.io](https://img.shields.io/crates/v/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 This crate provides `#[test_case]` procedural macro attribute that generates multiple parametrized tests using one body with different input parameters. A test is generated for each data set passed in `test_case` attribute. Under the hood, all test cases that share same body are grouped into `mod`, giving clear and readable test results. ## Getting Started First of all you have to add this dependency to your `Cargo.toml`: ```toml [dev-dependencies] test-case = "1.1.0" ``` Additionally, you have to import the procedural macro with `use` statement: ```rust use test_case::test_case; ``` ## Example usage: ```rust // The next two lines are not needed for 2018 edition or newer #[cfg(test)] extern crate test_case; #[cfg(test)] mod tests { use test_case::test_case; // Not needed for this example, but useful in general use super::*; #[test_case(4, 2 ; "when operands are swapped")] #[test_case(-2, -4 ; "when both operands are negative")] #[test_case(2, 4 ; "when both operands are positive")] fn multiplication_tests(x: i8, y: i8) { let actual = (x * y).abs(); assert_eq!(8, actual) } // You can still use regular tests too #[test] fn addition_test() { let actual = -2 + 8; assert_eq!(6, actual) } } ``` Output from `cargo test` for this example: ```sh $ cargo test running 4 tests test tests::addition_test ... ok 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 ``` ## Examples If your only assertion is just `assert_eq!`, you can pass the expectation as macro attribute using `=>` syntax: ```rust #[test_case( 2 => 2 ; "returns given number for positive input")] #[test_case(-2 => 2 ; "returns opposite number for non-positive input")] #[test_case( 0 => 0 ; "returns 0 for 0")] fn abs_tests(x: i8) -> i8 { if x > 0 { x } else { -x } } ``` Which is equivalent to ```rust #[test_case( 2, 2 ; "returns given number for positive input")] #[test_case(-2, 2 ; "returns opposite number for non-positive input")] #[test_case( 0, 0 ; "returns 0 for 0")] fn abs_tests(x: i8, expected: i8){ let actual = if x > 0 { x } else { -x }; assert_eq!(expected, actual); } ``` Attributes and expectation may be any expresion unless they contain `=>`, e.g. ```rust #[test_case(None, None => 0 ; "treats none as 0")] #[test_case(Some(2), Some(3) => 5)] #[test_case(Some(2 + 3), Some(4) => 2 + 3 + 4)] fn fancy_addition(x: Option, y: Option) -> i8 { x.unwrap_or(0) + y.unwrap_or(0) } ``` Note: in fact, `=>` is not prohibited, but the parser will always treat last `=>` sign as beginning of expectation definition. Test case names are optional. They are set using `;` followed by string literal at the end of macro attributes. Example generated code: ```rust mod fancy_addition { #[allow(unused_imports)] use super::*; fn fancy_addition(x: Option, y: Option) -> i8 { x.unwrap_or(0) + y.unwrap_or(0) } #[test] fn treats_none_as_0() { let expected = 0; let actual = fancy_addition(None, None); assert_eq!(expected, actual); } #[test] fn some_2_some_3() { let expected = 5; let actual = fancy_addition(Some(2), Some(3)); assert_eq!(expected, actual); } #[test] fn some_2_3_some_4() { let expected = 2 + 3 + 4; let actual = fancy_addition(Some(2 + 3), Some(4)); assert_eq!(expected, actual); } } ``` ## Modifiers ### inconclusive #### Context ignored test cases (deprecated, will be dropped in 2.0.0) If test case name (passed using `;` syntax described above) contains a word "inconclusive", generated test will be marked with `#[ignore]`. #### Keyword 'inconclusive' If test expectation is preceded by keyword `inconclusive` the test will be ignored as if it's description would contain word `inconclusive` ```rust #[test_case("42")] #[test_case("XX" ; "inconclusive - parsing letters temporarily doesn't work, but it's ok")] #[test_case("na" => inconclusive ())] fn parses_input(input: &str) { // ... } ``` Generated code: ```rust mod parses_input { // ... #[test] pub fn _42() { // ... } #[test] #[ignore] pub fn inconclusive_parsing_letters_temporarily_doesn_t_work_but_it_s_ok() { // ... } ``` ### matches If test expectation is preceded by `matches` keyword, the result will be tested whether it fits within provided pattern. ```rust #[test_case("foo", "bar" => matches ("foo", _) ; "first element of zipped tuple is correct")] #[test_case("foo", "bar" => matches (_, "bar") ; "second element of zipped tuple is correct")] fn zip_test<'a>(left: &'a str, right: &'a str) -> (&'a str, &'a str) { (left, right) } ``` ### panics If test case expectation is preceded by `panics` keyword and the expectation itself is `&str` **or** expresion that evaluates to `&str` then test case will be expected to panic during execution. ```rust #[test_case("foo" => panics "invalid input")] #[test_case("bar")] fn test_panicking(input: &str) { if input == "foo" { panic!("invalid input") } } ``` ### is|it (feature = "hamcrest_assertions") This feature requires addition of hamcrest2 crate to your Cargo.toml: ```toml test-case = { version = "1.1.0", features = ["hamcrest_assertions"] } hamcrest2 = "0.3.0" ``` After that you can use test cases with new keywords `is` and `it` which will allow you to use hamcrest2 assertions ([doc](https://docs.rs/hamcrest2/0.3.0/hamcrest2/)) ```rust #[test_case(&[1, 3] => is empty())] #[test_case(&[2, 3] => it contains(2))] #[test_case(&[2, 3] => it not(contains(3)))] #[test_case(&[2, 4] => it contains(vec!(2, 4)))] #[test_case(&[2, 3] => is len(1))] fn removes_odd_numbers(collection: &[u8]) -> &Vec { Box::leak(Box::new(collection.into_iter().filter(|x| *x % 2 == 0).copied().collect())) } ``` ## async in test cases Test cases can work with `tokio`, `async-std` and other runtimes, provided `#[test...]` attribute from mentioned libraries is used as a last attribute. eg. ```rust #[test_case("Hello, world" => true)] #[tokio::test] async fn runs_async_task(input: &str) -> bool { some_async_fn(input).await } ``` ## License Licensed under of MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) ### Contribution All contributions and comments are more than welcome! Don't be afraid to open an issue or PR whenever you find a bug or have an idea to improve this crate. 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 = "1.0" ``` *Compiler support: requires rustc 1.56+*
## 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 containing a `#[from]` attribute. Note that the variant must not contain any other fields beyond the source error and possibly a backtrace. A backtrace is captured from within the `From` impl if there is a field for it. ```rust #[derive(Error, Debug)] pub enum MyError { Io { #[from] source: io::Error, backtrace: Backtrace, }, } ``` - 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`. ```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. ```rust #[derive(Error, Debug)] pub enum MyError { Io { #[backtrace] source: io::Error, }, } ``` - 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/time/README.md # time [![minimum rustc: 1.57](https://img.shields.io/badge/minimum%20rustc-1.57-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/workflow/status/time-rs/time/Build/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 The time crate is guaranteed to compile with any release of rustc from the past six months. Optional feature flags that enable interoperability with third-party crates (e.g. rand) follow the policy of that crate if stricter. ## 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/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–10× 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.1 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns | | **`unicode-xid`** | 11.5 K | 1.88 ns | 2.14 ns | 3.48 ns | 15.63 ns | | **`ucd-trie`** | 10.2 K | 1.29 ns | 1.28 ns | 1.36 ns | 2.15 ns | | **`fst`** | 139 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns | | **`roaring`** | 66.1 K | 2.78 ns | 3.09 ns | 3.37 ns | 4.70 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 10× 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 Agreement – Data Files and Software (2016). 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/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.57.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.57 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.57: `cargo update -p time --precise 0.3.9` [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: 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: libhtp/htp/htp_utf8_decoder.c libhtp/htp/htp_utf8_decoder.h Copyright (c) 2008-2009 Bjoern Hoehrmann 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: libhtp/htp/bstr.c libhtp/htp/bstr.h libhtp/htp/bstr_builder.c libhtp/htp/bstr_builder.h libhtp/htp/htp.h libhtp/htp/htp_base64.c libhtp/htp/htp_base64.h libhtp/htp/htp_config.c libhtp/htp/htp_config.h libhtp/htp/htp_config_auto.h libhtp/htp/htp_config_private.h libhtp/htp/htp_connection.c libhtp/htp/htp_connection_parser.c libhtp/htp/htp_connection_parser.h libhtp/htp/htp_connection_parser_private.h libhtp/htp/htp_connection_private.h libhtp/htp/htp_content_handlers.c libhtp/htp/htp_cookies.c libhtp/htp/htp_core.h libhtp/htp/htp_decompressors.c libhtp/htp/htp_decompressors.h libhtp/htp/htp_hooks.c libhtp/htp/htp_hooks.h libhtp/htp/htp_list.c libhtp/htp/htp_list.h libhtp/htp/htp_list_private.h libhtp/htp/htp_multipart.c libhtp/htp/htp_multipart.h libhtp/htp/htp_multipart_private.h libhtp/htp/htp_parsers.c libhtp/htp/htp_php.c libhtp/htp/htp_private.h libhtp/htp/htp_request.c libhtp/htp/htp_request_apache_2_2.c libhtp/htp/htp_request_generic.c libhtp/htp/htp_request_parsers.c libhtp/htp/htp_response.c libhtp/htp/htp_response_generic.c libhtp/htp/htp_table.c libhtp/htp/htp_table.h libhtp/htp/htp_table_private.h libhtp/htp/htp_transaction.c libhtp/htp/htp_transaction.h libhtp/htp/htp_transcoder.c libhtp/htp/htp_urlencoded.c libhtp/htp/htp_urlencoded.h libhtp/htp/htp_utf8_decoder.c libhtp/htp/htp_utf8_decoder.h libhtp/htp/htp_util.c libhtp/htp/htp_version.h libhtp/test/test.c libhtp/test/test.h libhtp/test/test_bench.cpp libhtp/test/test_bstr.cpp libhtp/test/test_gunzip.cpp libhtp/test/test_hybrid.cpp libhtp/test/test_main.cpp libhtp/test/test_multipart.cpp libhtp/test/test_utils.cpp * 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: libhtp/htp/strlcat.c libhtp/htp/strlcpy.c 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: libhtp/test/gtest/gtest-all.cc libhtp/test/gtest/gtest.h Copyright 2008 Google 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 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. Author: wan@google.com (Zhanyong Wan) ## Files: libhtp/test/gtest/gtest-all.cc libhtp/test/gtest/gtest.h Copyright 2007, Google 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 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. Author: wan@google.com (Zhanyong Wan) ## Files: libhtp/test/gtest/gtest-all.cc Copyright 2008, Google 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 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. Author: mheule@google.com (Markus Heule) Google C++ Testing Framework (Google Test) Sometimes it's desirable to build Google Test by compiling a single file. This file serves this purpose. ## Files: libhtp/test/gtest/gtest-all.cc The following lines pull in the real gtest *.cc files. Copyright 2005, Google 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 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. Author: wan@google.com (Zhanyong Wan) The Google C++ Testing Framework (Google Test) ## Files: libhtp/test/gtest/gtest-all.cc Copyright 2007, Google 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 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. Author: wan@google.com (Zhanyong Wan) Utilities for testing Google Test itself and code that uses Google Test (e.g. frameworks built on top of Google Test). ## Files: libhtp/test/gtest/gtest-all.cc Copyright 2005, Google 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 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: libhtp/test/gtest/gtest-all.cc Copyright 2005, Google 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 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. Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev) This file implements death tests. ## Files: libhtp/test/gtest/gtest-all.cc Copyright 2008, Google 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 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. Authors: keith.ray@gmail.com (Keith Ray) ## Files: libhtp/test/gtest/gtest-all.cc Copyright 2008, Google 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 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. Author: wan@google.com (Zhanyong Wan) ## Files: libhtp/test/gtest/gtest-all.cc Copyright 2008, Google 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 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. Author: mheule@google.com (Markus Heule) The Google C++ Testing Framework (Google Test) ## Files: libhtp/test/gtest/gtest.h Copyright 2005, Google 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 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. Author: wan@google.com (Zhanyong Wan) The Google C++ Testing Framework (Google Test) This header file defines the public API for Google Test. It should be included by any test program that uses Google Test. IMPORTANT NOTE: Due to limitation of the C++ language, we have to leave some internal implementation details in this header file. They are clearly marked by comments like this: // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. Such code is NOT meant to be used by a user directly, and is subject to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user program! Acknowledgment: Google Test borrowed the idea of automatic test registration from Barthelemy Dagenais' (barthelemy@prologique.com) easyUnit framework. ## Files: libhtp/test/gtest/gtest.h Copyright 2005, Google 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 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. Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) The Google C++ Testing Framework (Google Test) This header file declares functions and macros used internally by Google Test. They are subject to change without notice. ## Files: libhtp/test/gtest/gtest.h Copyright 2005, Google 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 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. Authors: wan@google.com (Zhanyong Wan) Low-level types and utilities for porting Google Test to various platforms. They are subject to change without notice. DO NOT USE THEM IN USER CODE. ## Files: libhtp/test/gtest/gtest.h Copyright 2009 Google 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 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. Author: wan@google.com (Zhanyong Wan) ## Files: libhtp/test/gtest/gtest.h Copyright 2005, Google 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 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. Author: wan@google.com (Zhanyong Wan) The Google C++ Testing Framework (Google Test) This header file defines the public API for death tests. It is #included by gtest.h so a user doesn't need to include this directly. ## Files: libhtp/test/gtest/gtest.h Copyright 2005, Google 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 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. Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) The Google C++ Testing Framework (Google Test) This header file defines internal utilities needed for implementing death tests. They are subject to change without notice. ## Files: libhtp/test/gtest/gtest.h Copyright 2005, Google 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 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. Author: wan@google.com (Zhanyong Wan) The Google C++ Testing Framework (Google Test) This header file defines the Message class. IMPORTANT NOTE: Due to limitation of the C++ language, we have to leave some internal implementation details in this header file. They are clearly marked by comments like this: // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. Such code is NOT meant to be used by a user directly, and is subject to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user program! ## Files: libhtp/test/gtest/gtest.h Copyright 2008, Google 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 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. Authors: vladl@google.com (Vlad Losev) Macros and functions for implementing parameterized tests in Google C++ Testing Framework (Google Test) This file is generated by a SCRIPT. DO NOT EDIT BY HAND! ## Files: libhtp/test/gtest/gtest.h scripts/fuse_gtest.py depends on gtest's own header being #included *unconditionally*. Therefore these #includes cannot be moved inside #if GTEST_HAS_PARAM_TEST. Copyright 2008 Google 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 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. Author: vladl@google.com (Vlad Losev) ## Files: libhtp/test/gtest/gtest.h scripts/fuse_gtest.py depends on gtest's own header being #included *unconditionally*. Therefore these #includes cannot be moved inside #if GTEST_HAS_PARAM_TEST. Copyright 2003 Google 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 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. Authors: Dan Egnor (egnor@google.com) A "smart" pointer type with reference tracking. Every pointer to a particular object is kept on a circular linked list. When the last pointer to an object is destroyed or reassigned, the object is deleted. Used properly, this deletes the object when the last reference goes away. There are several caveats: - Like all reference counting schemes, cycles lead to leaks. - Each smart pointer is actually two pointers (8 bytes instead of 4). - Every time a pointer is assigned, the entire list of pointers to that object is traversed. This class is therefore NOT SUITABLE when there will often be more than two or three pointers to a particular object. - References are only tracked as long as linked_ptr<> objects are copied. If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS will happen (double deletion). A good use of this class is storing object references in STL containers. You can safely put linked_ptr<> in a vector<>. Other uses may not be as good. Note: If you use an incomplete type with linked_ptr<>, the class *containing* linked_ptr<> must have a constructor and destructor (even if they do nothing!). Bill Gibbons suggested we use something like this. Thread Safety: Unlike other linked_ptr implementations, in this implementation a linked_ptr object is thread-safe in the sense that: - it's safe to copy linked_ptr objects concurrently, - it's safe to copy *from* a linked_ptr and read its underlying raw pointer (e.g. via get()) concurrently, and - it's safe to write to two linked_ptrs that point to the same shared object concurrently. TODO(wan@google.com): rename this to safe_linked_ptr to avoid confusion with normal linked_ptr. ## Files: libhtp/test/gtest/gtest.h Copyright 2008 Google 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 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. Author: vladl@google.com (Vlad Losev) ## Files: libhtp/test/gtest/gtest.h Copyright 2006, Google 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 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. Author: wan@google.com (Zhanyong Wan) Google C++ Testing Framework definitions useful in production code. ## Files: libhtp/test/gtest/gtest.h Copyright 2008, Google 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 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. Author: mheule@google.com (Markus Heule) ## Files: libhtp/test/gtest/gtest.h Includes the auto-generated header that implements a family of generic predicate assertion macros. Copyright 2006, Google 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 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: libhtp/test/gtest/gtest_main.cc Copyright 2006, Google 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 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: 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/bpf_helpers.h SPDX-License-Identifier: GPL-2.0 ## 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/output-json-template.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/app-layer-rdp.c src/app-layer-rdp.h src/detect-dns-opcode.c src/detect-dns-opcode.h src/detect-sip-method.c src/detect-sip-method.h src/detect-sip-protocol.c src/detect-sip-protocol.h src/detect-sip-request-line.c src/detect-sip-request-line.h src/detect-sip-response-line.c src/detect-sip-response-line.h src/detect-sip-stat-code.c src/detect-sip-stat-code.h src/detect-sip-stat-msg.c src/detect-sip-stat-msg.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/detect-transform-dotprefix.h src/feature.c src/feature.h src/output-json-anomaly.h src/output-json-ftp.h src/output-json-modbus.h src/output-json-rdp.h src/tests/app-layer-htp-file.c src/tests/detect-snmp-community.c src/tests/detect-snmp-pdu_type.c src/tests/detect-snmp-version.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: libhtp/htp/htp_utf8_decoder.h LibHTP changes: - Changed the name of the function from "decode" to "utf8_decode" - Created a separate header file - Copied the license from the web page - Created a copy of the data and function "utf8_decode_allow_overlong", which does not treat overlong characters as invalid. ## Files: libhtp/ltmain.sh 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: libhtp/ltmain.sh 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: libhtp/ltmain.sh 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: libhtp/ltmain.sh 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: libhtp/ltmain.sh 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: libhtp/ltmain.sh 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: libhtp/ltmain.sh ltmain.sh You should have received a copy of the GNU General Public License along with this program. If not, see . ## Files: libhtp/ltmain.sh 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: libhtp/ltmain.sh 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: libhtp/ltmain.sh 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: libhtp/ltmain.sh ltmain.sh You should have received a copy of the GNU General Public License along with this program. If not, see . ## Files: python/suricata/ctl/filestore.py python/suricata/ctl/main.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. ## Files: python/suricata/ctl/filestore.py python/suricata/ctl/main.py 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: python/suricata/ctl/loghandler.py 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: python/suricata/sc/suricatasc.py Copyright(C) 2012-2023 Open Information Security Foundation ## Files: python/suricata/sc/suricatasc.py 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, version 2 of the License. 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. ## Files: 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-byte-extract.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-proto.h src/detect-engine-siggroup.h src/detect-engine-sigorder.h src/detect-engine-tag.h src/detect-flow.h src/detect-flowbits.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-reference.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/runmode-pfring.h src/source-nfq-prototypes.h src/source-nfq.h src/source-pcap-file-directory-helper.h src/source-pcap-file.h src/source-pfring.h src/stream-tcp-private.h src/stream-tcp-reassemble.h src/tests/detect-http-method.c src/threads.c src/tm-modules.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-bloomfilter-counting.c src/util-bloomfilter-counting.h src/util-bloomfilter.c src/util-bloomfilter.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-host-os-info.c src/util-host-os-info.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.c src/util-print.h src/util-privs.c src/util-privs.h src/util-radix-tree.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/util-var.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: 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/tm-modules.h src/tmqh-packetpool.h src/util-mpm-ac-bs.c src/util-mpm-ac-bs.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-ftp.h src/app-layer-htp-file.c src/app-layer-parser.c src/app-layer-protos.h src/app-layer-smtp.c src/app-layer-smtp.h src/counters.c 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-content-inspection.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.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-parse.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-tls.c src/output-json.h src/output.c 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-log-redis.c 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-frames.c src/app-layer-ftp.c src/app-layer-protos.c src/app-layer-ssl.c src/app-layer-ssl.h src/decode-events.c src/decode-events.h src/decode-icmpv4.h src/decode-icmpv6.h src/decode-ipv4.h src/decode-ipv6.h src/decode-tcp.h src/decode-udp.h src/decode-vlan.c src/decode-vlan.h src/defrag-hash.c src/defrag.c src/detect-app-layer-event.h src/detect-app-layer-protocol.c src/detect-app-layer-protocol.h src/detect-bytetest.c src/detect-content.c src/detect-content.h src/detect-csum.c 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-flowbits.c 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.c src/detect-lua.h src/detect-pcre.c src/detect-tls-cert-issuer.c src/detect-tls-cert-subject.c src/detect-uricontent.c src/detect.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-dns.c src/output-packet.c src/output-streaming.c src/output-streaming.h src/output-tx.c src/output-tx.h src/output.h src/packet.c src/packet.h src/runmode-pcap.c src/runmodes.h src/stream-tcp-cache.c src/stream-tcp-cache.h src/stream-tcp-reassemble.c src/stream-tcp.h src/suricata-common.h src/suricata.c src/tests/detect-file-data.c src/tests/detect-parse.c src/tm-threads.c src/tmqh-packetpool.c src/util-action.c src/util-byte.h src/util-cidr.c src/util-debug.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.c 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.c src/app-layer-dnp3.h src/app-layer-enip-common.h src/app-layer-enip.c src/app-layer-enip.h src/app-layer-krb5.c src/app-layer-krb5.h src/detect-base64-data.c src/detect-base64-data.h src/detect-cipservice.c src/detect-dnp3.h src/detect-engine-enip.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/output-json-krb5.h src/output-json-sip.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 src/util-lua-tls.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-enip-common.c src/detect-base64-decode.h src/detect-cipservice.h src/detect-dnp3.c src/detect-engine-enip.c src/detect-template-rust-buffer.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/app-layer-events.c 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-expectation.c src/app-layer-expectation.h src/app-layer-smb.c src/app-layer-tftp.c src/output-json-dcerpc.c src/output-json-ftp.c src/output-json-smb.c src/util-napatech.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: src/app-layer-frames.h src/app-layer-htp-range.c src/app-layer-htp-range.h src/app-layer-quic.c src/app-layer-quic.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/detect-transform-xor.c src/detect-transform-xor.h src/output-eve-syslog.c src/output-eve-syslog.h src/output-json-bittorrent-dht.c src/output-json-bittorrent-dht.h src/output-json-quic.c src/output-json-quic.h src/runmode-dpdk.c src/runmode-dpdk.h src/source-dpdk.c src/source-dpdk.h src/tests/detect-transform-xor.c src/util-datalink.c src/util-datalink.h 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 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-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/tm-threads.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/detect-dns-query.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.c src/log-stats.h src/log-tcp-data.c src/log-tlsstore.c src/output-json-netflow.h src/output-json-ssh.h src/output-json-stats.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.c src/util-lua-dns.h src/util-lua-http.c src/util-lua-http.h src/util-lua-smtp.c src/util-lua-smtp.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.c src/app-layer-htp.h src/app-layer-parser.h src/decode-icmpv4.c src/decode-udp.c src/detect-byte-extract.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-transform-compress-whitespace.c src/detect-transform-md5.c src/detect-transform-sha1.c src/detect-transform-sha256.c src/detect-transform-strip-whitespace.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/output-json-flow.c 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/app-layer-mqtt.c src/app-layer-mqtt.h src/app-layer-rfb.c src/app-layer-rfb.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-mqtt-connack-sessionpresent.c src/detect-mqtt-connack-sessionpresent.h src/detect-mqtt-connect-clientid.c src/detect-mqtt-connect-clientid.h src/detect-mqtt-connect-flags.c src/detect-mqtt-connect-flags.h src/detect-mqtt-connect-password.c src/detect-mqtt-connect-password.h src/detect-mqtt-connect-username.c src/detect-mqtt-connect-username.h src/detect-mqtt-connect-willmessage.c src/detect-mqtt-connect-willmessage.h src/detect-mqtt-connect-willtopic.c src/detect-mqtt-connect-willtopic.h src/detect-mqtt-flags.c src/detect-mqtt-flags.h src/detect-mqtt-protocol-version.c src/detect-mqtt-protocol-version.h src/detect-mqtt-publish-message.c src/detect-mqtt-publish-message.h src/detect-mqtt-publish-topic.c src/detect-mqtt-publish-topic.h src/detect-mqtt-qos.c src/detect-mqtt-qos.h src/detect-mqtt-reason-code.c src/detect-mqtt-reason-code.h src/detect-mqtt-subscribe-topic.h src/detect-mqtt-type.c src/detect-mqtt-type.h src/detect-mqtt-unsubscribe-topic.h src/detect-rfb-name.c src/detect-rfb-name.h src/detect-rfb-secresult.h src/detect-rfb-sectype.c src/detect-rfb-sectype.h src/detect-transform-dotprefix.c src/detect-transform-pcrexform.c src/detect-transform-pcrexform.h src/detect-transform-urldecode.c src/detect-transform-urldecode.h src/main.c src/output-json-http2.h src/output-json-mqtt.h src/output-json-rfb.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-lua-hassh.c src/util-lua-hassh.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-nfs-tcp.h src/app-layer-nfs-udp.h src/app-layer-ntp.c src/app-layer-ntp.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/detect-transform-compress-whitespace.h src/detect-transform-md5.h src/detect-transform-sha1.h src/detect-transform-sha256.h src/detect-transform-strip-whitespace.h src/output-json-dcerpc.h src/output-json-smb.h src/output-json-tftp.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 src/util-napatech.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: src/app-layer-register.c src/datasets.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-sip.c src/app-layer-sip.h src/output-json-modbus.c Copyright (C) 2019-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-snmp.c src/detect-snmp-community.c src/detect-snmp-community.h src/detect-snmp-pdu_type.h src/detect-snmp-version.h src/output-json-snmp.h 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/app-layer-snmp.h src/datasets-md5.c src/datasets-md5.h src/datasets-reputation.h src/datasets-sha256.c src/datasets-sha256.h src/datasets-string.c 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/app-layer.c src/conf-yaml-loader.c src/conf.c src/conf.h src/decode.c src/decode.h src/defrag-hash.h src/detect-app-layer-event.c src/detect-distance.c src/detect-engine-analyzer.c src/detect-engine-analyzer.h src/detect-engine-build.c src/detect-filemagic.c src/detect-http-server-body.c src/detect-within.c src/detect.h src/flow-hash.c src/flow-manager.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/stream-tcp.c src/util-buffer.c src/util-buffer.h src/util-error.h src/util-path.c src/util-profiling.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 src/util-profiling-rulegroups.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-dhcp-leasetime.c src/detect-dhcp-leasetime.h src/detect-dhcp-rebinding-time.c src/detect-dhcp-rebinding-time.h src/detect-dhcp-renewal-time.c src/detect-dhcp-renewal-time.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-snmp-usm.c src/detect-snmp-usm.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/decode-chdlc.c src/decode-erspan.c src/decode-esp.c src/decode-geneve.c src/decode-nsh.c src/detect-rfb-secresult.c src/output-json-http2.c src/output-json-mqtt.c src/output-json-rfb.c src/output-json-tftp.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-ipv4.c src/decode-ipv6.c src/decode-tcp.c src/defrag-config.c src/defrag-config.h src/defrag.h src/detect-engine-sigorder.c src/detect-engine-state.h src/detect-http-host.h src/detect-lua-extensions.h src/detect-tag.h src/detect-threshold.h src/flow-bit.c src/flow-storage.h src/flow-util.c src/flow-var.h src/flow.c src/flow.h src/host.h src/ippair.h src/log-httplog.c src/output-json-dns.h src/output-packet.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 src/util-var.c 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/decode-mpls.c src/host-bit.c src/ippair-bit.c src/output-json-ssh.c src/runmode-netmap.h src/source-netmap.h 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-ppp.c src/detect-noalert.c src/runmodes.c 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/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-buffer.c 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-teredo.h src/detect-pkt-data.c src/source-napatech.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: src/decode-vxlan.c src/output-json-anomaly.c src/output-json-rdp.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-queue.c src/defrag-queue.h 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-timeout.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/output-json-tls.h src/util-atomic.c src/util-base64.c src/util-base64.h 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.c 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/detect-asn1.c src/detect-asn1.h src/detect-base64-decode.c src/detect-bytemath.c src/detect-http2.c src/detect-ike-vendor.c src/detect-mqtt-subscribe-topic.c src/detect-mqtt-unsubscribe-topic.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-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-prefilter.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-log-redis.h 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-dataset.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-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/runmode-pfring.c src/tests/detect-http-header.c src/tests/detect-http-host.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: 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-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/reputation.c src/reputation.h src/source-pcap.c src/source-pcap.h src/source-pfring.c 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: src/detect-dns-query.c 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/detect-engine-build.h src/detect-engine-content-inspection.c src/detect-engine-register.c src/detect-engine-register.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/flow-timeout.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/detect-tls-sni.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-luajit.c src/util-luajit.h src/util-mpm-hs.c src/util-mpm-hs.h src/util-thash.c src/util-thash.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-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-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-ja4-hash.c src/detect-ja4-hash.h src/detect-requires.c src/detect-requires.h src/detect-transform-casechange.c src/detect-transform-casechange.h src/detect-transform-header-lowercase.c src/detect-transform-header-lowercase.h src/detect-transform-strip-pseudo-headers.c src/detect-transform-strip-pseudo-headers.h src/output-eve-stream.c 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-krb5-cname.c src/detect-krb5-sname.c src/output-filestore.c src/output-json-template.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-rust-buffer.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-snmp-pdu_type.c src/detect-snmp-version.c 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/output-json-krb5.c src/output-json-sip.c src/output-json-snmp.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 Copyright (C) 2016-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-alert.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 src/output-json-stats.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-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/runmode-napatech.c src/runmode-napatech.h src/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: src/runmode-unittests.c Copyright (C) 2013-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/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/output-json-stats.c src/util-ja4.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: 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-decode-mime.c Copyright (C) 2012 BAE Systems 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/util-decode-mime.h Copyright (C) 2012 BAE Systems 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/util-device.h Copyright (C) 2011-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-exception-policy.c src/util-exception-policy.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/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/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.