{"id":24990432,"url":"https://github.com/pivpn/grepcidr","last_synced_at":"2025-03-29T12:42:49.180Z","repository":{"id":110991626,"uuid":"514834548","full_name":"pivpn/grepcidr","owner":"pivpn","description":"grepcidr repository to be used by pivpn with https instead using origin source with http original source at: http://www.pc-tools.net/unix/grepcidr/","archived":false,"fork":false,"pushed_at":"2022-07-17T12:16:24.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T13:41:14.428Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pivpn.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-17T12:16:04.000Z","updated_at":"2024-12-01T19:39:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6f77d82-d8fc-444e-ac41-49add9c80f29","html_url":"https://github.com/pivpn/grepcidr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivpn%2Fgrepcidr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivpn%2Fgrepcidr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivpn%2Fgrepcidr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivpn%2Fgrepcidr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pivpn","download_url":"https://codeload.github.com/pivpn/grepcidr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246187210,"owners_count":20737459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-04T13:36:27.848Z","updated_at":"2025-03-29T12:42:49.174Z","avatar_url":"https://github.com/pivpn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"grepcidr 2.0 - Filter IPv4 and IPv6 addresses matching CIDR patterns\nCopyright (C) 2004 - 2014  Jem E. Berkes \u003cjem@berkes.ca\u003e\n\thttp://www.pc-tools.net/unix/grepcidr/\n\thttp://www.berkes.ca/\n\t\nSponsored in part by the Spamhaus Project, http://www.spamhaus.org/\n\n\nDESCRIPTION\n-----------\ngrepcidr can be used to filter a list of IP addresses against one or more\nClassless Inter-Domain Routing (CIDR) specifications.  As with grep, there\nare options to invert matching and load patterns from a file.  grepcidr is\ncapable of efficiently processing large numbers of IPs and networks.\n\ngrepcidr has endless uses in network software, including: mail filtering and\nprocessing, network security, log analysis, and many custom applications.\n\n\nCOMPILING \u0026 INSTALLING\n----------------------\n\tmake\n\tmake doc\n\tmake install\n\n\n\nCOMMAND USAGE\n-------------\n\n\tgrepcidr [-V] [-cisvx] PATTERN [FILE...]\n\tgrepcidr [-V] [-cisvx] [-e PATTERN | -f PATFILE] [FILE...]\n\n\n-V\tShow software version\n-c\tDisplay count of the matching lines, instead of showing the lines\n-i\tInverse match, include lines without an IP, implies -v\n-s\tEnforce strict alignment of CIDR mask; host portion must be all zero\n-v\tInvert the sense of matching, output lines with IPs that don't match\n-x\tStrict matching, only look at start of line\n-e\tSpecify individual IP or CIDR pattern(s) on command-line\n-f\tLoad individual IP or CIDR pattern(s) from file\n\n\nMAJOR 2.0 CHANGES\n-----------------\n\nVersion 2.0 adds support for IPv6 addresses.  As with 1.4, version 2.0\nfinds IP addresses anywhere on the line.  Use -x to search only from the\nstart of line, like versions 1.3 and earlier.\n\n\nUSAGE NOTES\n-----------\n\nPATTERN specified on the command line may contain multiple patterns\nseparated by whitespace or commas. For long lists of network patterns,\nuse -f to load a file where each line contains one pattern (can be IPv4\nor IPv6).  Blank lines and comments starting with # are ignored.\n\nEach IPv4 pattern, whether on command line or loaded from a file, may be:\na.b.c.d/xy\t(CIDR format)\na.b.c.d-e.f.g.h\t(IP range)\na.b.c.d\t\t(Single IP)\n\nAnd similarly for IPv6:\na:b:c::/xyz\t(CIDR format)\na:b:c::\t\t(Single IP)\n\nDotted-decimal IPv4 format, or any legal IPv6 format is supported (see:\nman inet_pton).\n\nIP addresses that appear anywhere on the input line will be compared and\nmatched against the patterns.  To be recognized, an IP (field) must end\nwith terminating text.  An IPv4 field terminates upon anything other than\nalphanumeric or dot.  An IPv6 field terminates upon anything other than\nalphanumeric, dot, or colon.  This is to prevent accidental matching of\nambiguous text such as host names containing reverse DNS.\n\nUse the -x option to do a strict parse without searching the whole line,\nand grepcidr will only look for the single IP at the start of the line.\n\n\nEXAMPLES\n--------\n\ngrepcidr -f ournetworks blacklist \u003e abuse.log\n\tFind customers (CIDR ranges in file) that appear in blacklist\n\t\ngrepcidr 2001:db8::/32 log.1 log.2\n\tSearch for this IPv6 network inside two files\n\ngrepcidr 127.0.0.0/8 iplog\n\tSearches for any localnet IP addresses inside the iplog file\n\ngrepcidr \"192.168.0.1-192.168.10.13\" iplog\n\tSearches for IPs matching indicated range in the iplog file\n\nscript | grepcidr -vf whitelist \u003e blacklist\n\tCreate a blacklist, with whitelisted networks removed (inverse)\n\ngrepcidr -f list1 list2\n\tCross-reference two lists, outputs IPs common to both lists\n\n\nEXIT STATUS\n-----------\n\nAs with grep: the exit status is 0 if matching IPs are found, and 1\nif not found.  If an error occurred the exit status is 2. \n\t\n\t\nTHANKS\n------\n\nSponsored in part by the Spamhaus Project, http://www.spamhaus.org/\n\nThanks to John Levine \u003cjohnl@taugh.com\u003e for sharing his alternative\nimplementation.  I used a couple ideas from his code, such as portable\n128-bit numbers and support for multiple input files. However, John's\nversion is quite different and represents a significant fork in the project.\n\nThanks to Ryan Finnie \u003cryan@finnie.org\u003e for his work on the Debian package.\nI've adopted several of his changes including the Makefile, and the DocBook\nformat which now is the source of the man page.  Thanks to Ryan for writing\nthe first manual in DocBook format.\n\nMany thanks to Dick Wesseling \u003cftu@fi.uu.nl\u003e who suggested an improved data\nstructure format as well as binary search, to improve grepcidr performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpivpn%2Fgrepcidr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpivpn%2Fgrepcidr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpivpn%2Fgrepcidr/lists"}