Support GeoLite2 countryinfo data, use Text::CSV #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's a new PR with some further development. I think it fixes all the issues in #1, and a bug with GeoLite2 countryinfo parsing. I hadn't realized that parsing concatenated IPv4/IPv6 input was the way it's used for xtables, or that
contrib/Makefile
did that. There's also a commit to use Text::CSV for output, but that doesn't seem useful since we always quote all output values anyway, and it slows the script down slightly.@mschmitt: if you take any/all of this, would you take entire commits, or ask me to refactor/improve them for you? After you took part of #1, it was somewhat painful to edit/rebase the rest of my work onto your new commit. It would have been much easier for me to split the commit myself and give it to you.
Also noted: I'm not sure what
contrib/Makefile
is there for, but it wasn't very useful for testing for me. It requires Linux, root access, and installed xtables and xtables geoIP data. It took a while to work this out, I'm using FreeBSD and iptables/xtables doesn't even exist there.